Skip to content

Commit 0dba594

Browse files
committed
some fixes
1 parent b979075 commit 0dba594

File tree

4 files changed

+42
-32
lines changed

4 files changed

+42
-32
lines changed

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/ExtractBCsFromOrig.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ def create_reduced_bin(input_file, output_file, indices):
147147
mom_catch_params_file = 'clsm/catch_params.nc4'
148148
mom_catchcn_params_file = 'clsm/catchcn_params.nc4'
149149

150-
# create_reduced_nc4(catch_params_file, mom_catch_params_file, indices)
151-
# create_reduced_nc4(catchcn_params_file, mom_catchcn_params_file, indices)
150+
create_reduced_nc4(catch_params_file, mom_catch_params_file, indices)
151+
create_reduced_nc4(catchcn_params_file, mom_catchcn_params_file, indices)
152152

153153
files = glob.glob(bcs_dir + '/' + bcs_ver + '/land/' + air_res + '/*.da*')
154154
for file in files:
155155
fname = os.path.basename(file)
156156
if 'vegdyn' in fname:
157-
create_reduced_nc4( file,'clsm/vegdyn.dat', indices)
157+
create_reduced_nc4( file,'clsm/vegdyn.data', indices)
158158
else:
159159
shortname = 'clsm/' + fname.split('_')[0] + '.dat'
160160
create_reduced_bin(file, shortname, indices)

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/make_bcs_cube.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
bin/mk_runofftbl.x -g CF{NC}x6C{SGNAME}_{OCEAN_VERSION}{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter -v {lbcsv}
4444
4545
if ({SKIPLAND} != True) then
46-
bin/ExtractBCsFromOrig.py {BCS_DIR} {lbcvs} CF{NC}x6C{SGNAME} {OCEAN_VERSION}{DATENAME}{IMO}x{POLENAME}{JMO}
46+
bin/mkCatchParam.x -x {NX} -y {NY} -g CF{NC}x6C{SGNAME}_{OCEAN_VERSION}{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter -v {lbcsv} -p no
47+
bin/ExtractBCsFromOrig.py {BCS_DIR} {lbcsv} CF{NC}x6C{SGNAME} {OCEAN_VERSION}{DATENAME}{IMO}x{POLENAME}{JMO}
4748
endif
4849
4950
chmod 755 bin/create_README.csh

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/make_bcs_shared.py

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -115,31 +115,30 @@ def get_script_mv(grid_type):
115115
ln -s vegdyn_{RC}.dat vegdyn_{RC}.nc4
116116
cd ../../
117117
118-
/bin/mv clsm/ar.new \\
119-
clsm/bf.dat \\
120-
clsm/ts.dat \\
121-
clsm/catchment.def \\
122-
clsm/cti_stats.dat \\
123-
clsm/tau_param.dat \\
124-
clsm/soil_param.dat \\
125-
clsm/mosaic_veg_typs_fracs \\
126-
clsm/soil_param.first \\
127-
clsm/bad_sat_param.tiles \\
128-
clsm/README \\
129-
clsm/lai.* \\
130-
clsm/AlbMap* \\
131-
clsm/g5fmt \\
132-
clsm/vegetation.hst2 \\
133-
clsm/pfaf_fractions.dat \\
134-
clsm/plots \\
135-
clsm/CLM_veg_typs_fracs \\
136-
clsm/Grid2Catch_TransferData.nc \\
137-
clsm/CLM_NDep_SoilAlb_T2m \\
138-
clsm/CLM4.5_abm_peatf_gdp_hdm_fc \\
139-
clsm/catch_params.nc4 \\
140-
clsm/catchcn_params.nc4 \\
141-
clsm/country_and_state_code.data \\
142-
land/{GRIDNAME}/clsm/
118+
/bin/mv clsm/ar.new land/{GRIDNAME}/clsm/
119+
/bin/mv clsm/bf.dat land/{GRIDNAME}/clsm/
120+
/bin/mv clsm/ts.dat land/{GRIDNAME}/clsm/
121+
/bin/mv clsm/catchment.def land/{GRIDNAME}/clsm/
122+
/bin/mv clsm/cti_stats.dat land/{GRIDNAME}/clsm/
123+
/bin/mv clsm/tau_param.dat land/{GRIDNAME}/clsm/
124+
/bin/mv clsm/soil_param.dat land/{GRIDNAME}/clsm/
125+
/bin/mv clsm/mosaic_veg_typs_fracs land/{GRIDNAME}/clsm/
126+
/bin/mv clsm/soil_param.first land/{GRIDNAME}/clsm/
127+
/bin/mv clsm/bad_sat_param.tiles land/{GRIDNAME}/clsm/
128+
/bin/mv clsm/README land/{GRIDNAME}/clsm/
129+
/bin/mv clsm/lai.* land/{GRIDNAME}/clsm/
130+
/bin/mv clsm/AlbMap* land/{GRIDNAME}/clsm/
131+
/bin/mv clsm/g5fmt land/{GRIDNAME}/clsm/
132+
/bin/mv clsm/vegetation.hst2 land/{GRIDNAME}/clsm/
133+
/bin/mv clsm/pfaf_fractions.dat land/{GRIDNAME}/clsm/
134+
/bin/mv clsm/plots land/{GRIDNAME}/clsm/
135+
/bin/mv clsm/CLM_veg_typs_fracs land/{GRIDNAME}/clsm/
136+
/bin/mv clsm/Grid2Catch_TransferData.nc land/{GRIDNAME}/clsm/
137+
/bin/mv clsm/CLM_NDep_SoilAlb_T2m land/{GRIDNAME}/clsm/
138+
/bin/mv clsm/CLM4.5_abm_peatf_gdp_hdm_fc land/{GRIDNAME}/clsm/
139+
/bin/mv clsm/catch_params.nc4 land/{GRIDNAME}/clsm/
140+
/bin/mv clsm/catchcn_params.nc4 land/{GRIDNAME}/clsm/
141+
/bin/mv clsm/country_and_state_code.data land/{GRIDNAME}/clsm/
143142
144143
"""
145144
mv_template = mv_template + get_change_til_file(grid_type)

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/mkCatchParam.F90

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ PROGRAM mkCatchParam
3737
integer :: NC = i_raster, NR = j_raster
3838
character*5 :: LBCSV = 'UNDEF'
3939
character*128 :: Gridname = ''
40+
character*128 :: withbcs = ''
4041
character*128 :: ARG, MaskFile
4142
character*256 :: CMD
4243
character*1 :: opt
@@ -47,7 +48,7 @@ PROGRAM mkCatchParam
4748
integer :: I, J, command_argument_count, nxt
4849
real*8 :: dx, dy, lon0
4950
logical :: regrid
50-
character(len=400), dimension (6) :: Usage
51+
character(len=128), dimension (7) :: Usage
5152
character*128 :: Grid2
5253
character*2 :: poles
5354
character*128 :: fnameRst = '' ! a.k.a. "gfile[r]" in mod_process_hres_data.F90
@@ -115,7 +116,8 @@ PROGRAM mkCatchParam
115116
USAGE(3) =" -y: Size of latitude dimension of input raster. DEFAULT: 4320 "
116117
USAGE(4) =" -g: Gridname (name of the .til or .rst file *without* file extension) "
117118
USAGE(5) =" -b: Position of the dateline in the first grid box (DC or DE). DEFAULT: DC "
118-
USAGE(6) =" -v LBCSV : Land bcs version (F25, GM4, ICA, NL3, NL4, NL5, v06, v07, v08 v09 ) "
119+
USAGE(6) =" -v: Land bcs version (F25, GM4, ICA, NL3, NL4, NL5, v06, v07, v08 v09 ) "
120+
USAGE(7) =" -p: if no, it creates catchment_def and nc4 tile files then exits "
119121

120122
! Process Arguments
121123
!------------------
@@ -130,7 +132,7 @@ PROGRAM mkCatchParam
130132
write (log_file,'(a)')trim(cmd)
131133
write (log_file,'(a)')' '
132134
endif
133-
135+
withbcs = 'yes'
134136
I = command_argument_count()
135137
if(I < 1 .or. I > 10) then
136138
write (log_file,'(a)') "Wrong Number of arguments: ", i
@@ -165,6 +167,8 @@ PROGRAM mkCatchParam
165167
call init_bcs_config (trim(LBCSV)) ! get bcs details from version string
166168
case ('b')
167169
DL = trim(arg)
170+
case ('p')
171+
withbcs = trim(arg)
168172
case default
169173
do j = 1,size(usage)
170174
print "(sp,a100)", Usage(j)
@@ -274,6 +278,12 @@ PROGRAM mkCatchParam
274278
endif
275279
write (log_file,'(a)')' '
276280

281+
if (trim(withbcs) == 'no') then
282+
write (log_file,'(a)')'Skipping MOM BCs. BCs will be extracted from the corresponding BCs. '
283+
close (log_file,status='keep')
284+
call exit(0)
285+
endif
286+
277287
call ReadTilingNC4( trim(fnameTil)//".nc4", iTable = iTable)
278288
N_land = count(iTable(:,0) == 100) ! n_land = number of land tiles
279289
allocate(tile_j_dum, source = iTable(1:n_land,7)) ! possible used in cti_stats.dat

0 commit comments

Comments
 (0)