Skip to content

Commit 303b84f

Browse files
Yujin ZengYujin Zeng
authored andcommitted
outlet version definition was moved to rmTinyCatchParaMod.F90
1 parent ecda649 commit 303b84f

File tree

4 files changed

+36
-29
lines changed

4 files changed

+36
-29
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@
5353
/bin/mv rst/Pfafstetter-M.rst rst/Pfafstetter.rst
5454
bin/CombineRasters.x -f 0 -t {NT} {OCEAN_VERSION}{DATENAME}{IMO}x{POLENAME}{JMO} Pfafstetter >/dev/null
5555
bin/CombineRasters.x -t {NT} CF{NC}x6C{SGNAME} {OCEAN_VERSION}{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter
56-
bin/mk_runofftbl.x -g CF{NC}x6C{SGNAME}_{OCEAN_VERSION}{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter -v {lbcsv}
5756
setenv OMP_NUM_THREADS 1
58-
if ({SKIPLAND} != True) bin/mkCatchParam.x -x {NX} -y {NY} -g CF{NC}x6C{SGNAME}_{OCEAN_VERSION}{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter -v {lbcsv}
57+
if ({SKIPLAND} != True) then
58+
bin/mkCatchParam.x -x {NX} -y {NY} -g CF{NC}x6C{SGNAME}_{OCEAN_VERSION}{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter -v {lbcsv}
59+
bin/mk_runofftbl.x -g CF{NC}x6C{SGNAME}_{OCEAN_VERSION}{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter
60+
endif
5961
endif
6062
6163
if ( {STEP2} == True ) then

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@
4141
/bin/mv rst/Pfafstetter-M.rst rst/Pfafstetter.rst
4242
bin/CombineRasters.x -f 0 -t {NT} {DATENAME}{IMO}x{POLENAME}{JMO} Pfafstetter >/dev/null
4343
bin/CombineRasters.x -t {NT} DC{IM}xPC{JM} {DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter
44-
bin/mk_runofftbl.x -g DC{IM}xPC{JM}_{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter -v {lbcsv}
4544
setenv OMP_NUM_THREADS 1
46-
if ( {SKIPLAND} != True ) bin/mkCatchParam.x -x {NX} -y {NY} -g DE{IMO}xPE{JMO}_DE{IMO}xPE{JMO}-Pfafstetter -v {lbcsv}
45+
if ( {SKIPLAND} != True ) then
46+
bin/mkCatchParam.x -x {NX} -y {NY} -g DE{IMO}xPE{JMO}_DE{IMO}xPE{JMO}-Pfafstetter -v {lbcsv}
47+
bin/mk_runofftbl.x -g DC{IM}xPC{JM}_{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter
48+
endif
4749
setenv OMP_NUM_THREADS {NCPUS}
4850
if ( {SKIPLAND} != True ) bin/mkCatchParam.x -x {NX} -y {NY} -g DE{IMO}xPE{JMO}_DE{IMO}xPE{JMO}-Pfafstetter -v {lbcsv}
4951
chmod 755 bin/create_README.csh

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

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@ program mk_runofftbl
44
!
55
! !ARGUMENTS:
66
!
7-
! Usage = "mk_runofftbl.x -g Gridname -v LBCSV"
7+
! Usage = "mk_runofftbl.x -g Gridname"
88
!
99
! -g: Gridname: a string that describes the grids associated with the atmosphere and ocean model configuration
1010
! eg, CF0180x6C_M6TP0072x0036-Pfafstetter
11-
! -v: LBCSV : Land bcs version (F25, GM4, ICA, NL3, NL4, NL5, v06, v07, v08, v09, v10, v11, v12, ...)
1211
!
1312
! This program generates the runoff table *.trn and *.TRN files that are used in the Catchment model for
1413
! directing runoff to its ocean sink. The inputs are (i) bcs geometry files associated with the Gridname
1514
! and (ii) a binary file ("Outlet_latlon.43200x21600") that provides the land raster grid cells where the
1615
! outlets are located. The latter file is either created by [..]/Raster/preproc/routing/run_routing_raster.py
1716
! or from Randy's ([email protected]) old file under {MAKE_BCS_INPUT_DIR}/land/route/v1.
1817
! The program first moves the outlet locations from the land raster grid cells to the nearest ocean pixels
19-
! by calling outlets_to_ocean() (only with bcs version v11, v12 or later) and then generates the runoff table files.
20-
! The program outlets_to_ocean() currently works only for the MOM5 and MOM6 tripolar ocean grids.
18+
! by calling outlets_to_ocean() and then generates the runoff table files.
19+
! The subroutine outlets_to_ocean() currently works only for the MOM5 and MOM6 tripolar ocean grids.
2120
!
2221
!Basically based on bcs version we would use have these 3 options:
2322
!=======================================================
2423
!bcs version --> Outlet lat/lon file version
2524
!---------------------------------------------------
2625
!v12 --> (new) v2 (produced with Yujin's pre-processing routines)
2726
!v11 --> (old) v1 (produced with Randy's old file)
28-
!otherwise --> n/a (produced with Randy's old file, but do not move outlet locations to ocean)
27+
!otherwise --> N/A (do not run routing module of make_bcs)
2928
!=========================================================
3029
!
3130
! Yujin Zeng - June 17, 2024
3231
3332

3433
use mapl_hashmod
3534
use mapl_sortmod
35+
use rmTinyCatchParaMod, only :: OUTLETV
3636
use netcdf
3737

3838
implicit none
@@ -57,13 +57,18 @@ program mk_runofftbl
5757
integer :: nxt, command_argument_count
5858
character*(128) :: arg
5959
character*(128) :: Usage = "mk_runofftbl.x -g CF0180x6C_M6TP0072x0036-Pfafstetter -v v12"
60-
character*5 :: LBCSV = 'UNDEF'
61-
character*5 :: OUTLETV = 'UNDEF'
6260
character*1 :: opt
6361

6462
! ------------------------------------------------------------------
6563

6664
call get_environment_variable ("MAKE_BCS_INPUT_DIR",MAKE_BCS_INPUT_DIR)
65+
66+
if(trim(OUTLETV)=="v1".or.trim(OUTLETV)=="v2")then
67+
fileLL=trim(MAKE_BCS_INPUT_DIR)//'/land/route/'//trim(OUTLETV)//'/Outlet_latlon.'
68+
else
69+
print *, "Routing files will not be produced with the selected land BCs version"
70+
stop
71+
endif
6772

6873
! Read inputs -----------------------------------------------------
6974

@@ -91,8 +96,6 @@ program mk_runofftbl
9196
select case (opt)
9297
case ('g')
9398
Gridname = trim(arg)
94-
case ('v')
95-
LBCSV = trim(arg)
9699
case default
97100
print *, "Wrong flag -", opt
98101
print *, "Example usage with defaults: "
@@ -103,19 +106,8 @@ program mk_runofftbl
103106
call get_command_argument(nxt,arg)
104107
end do
105108

106-
if(trim(LBCSV)=="v11")then
107-
OUTLETV="v1"
108-
else if(trim(LBCSV)=="v12")then
109-
OUTLETV="v2"
110-
else
111-
OUTLETV="others"
112-
endif
113-
114-
if(trim(OUTLETV)=="v1".or.trim(OUTLETV)=="v2")then
115-
fileLL=trim(MAKE_BCS_INPUT_DIR)//'/land/route/'//trim(OUTLETV)//'/Outlet_latlon.'
116-
else
117-
fileLL=trim(MAKE_BCS_INPUT_DIR)//'/land/route/v1/Outlet_latlon.'
118-
endif
109+
print *, " "
110+
print*, "Working with input BCs grid: ", trim(Gridname)
119111

120112
! ------------------------------------------------------------------
121113

@@ -158,9 +150,7 @@ program mk_runofftbl
158150
print *, "- Output file: ", fileB
159151
print *, " "
160152

161-
if(trim(OUTLETV)=="v1".or.trim(OUTLETV)=="v2")then
162-
call outlets_to_ocean(Gridname,lons,lats,nx,ny)
163-
endif
153+
call outlets_to_ocean(Gridname,lons,lats,nx,ny)
164154

165155
open(10,file=fileT, form="formatted", status="old")
166156

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ module rmTinyCatchParaMod
5252
character*6, public, save :: SOILBCS = 'UNDEF'
5353
character*6, public, save :: MODALB = 'UNDEF'
5454
character*10, public, save :: SNOWALB = 'UNDEF'
55+
character*5, public, save :: OUTLETV = 'UNDEF'
5556
REAL, public, save :: GNU = MAPL_UNDEF
5657

5758
character*512 :: MAKE_BCS_INPUT_DIR
@@ -103,6 +104,7 @@ SUBROUTINE init_bcs_config (LBCSV)
103104
SOILBCS = 'NGDC'
104105
MODALB = 'MODIS1'
105106
SNOWALB = 'LUT'
107+
OUTLETV = "N/A"
106108
GNU = 2.17
107109
use_PEATMAP = .false.
108110
jpl_height = .false.
@@ -112,6 +114,7 @@ SUBROUTINE init_bcs_config (LBCSV)
112114
SOILBCS = 'NGDC'
113115
MODALB = 'MODIS2'
114116
SNOWALB = 'LUT'
117+
OUTLETV = "N/A"
115118
GNU = 1.0
116119
use_PEATMAP = .false.
117120
jpl_height = .false.
@@ -121,6 +124,7 @@ SUBROUTINE init_bcs_config (LBCSV)
121124
SOILBCS = 'HWSD'
122125
MODALB = 'MODIS2'
123126
SNOWALB = 'LUT'
127+
OUTLETV = "N/A"
124128
GNU = 1.0
125129
use_PEATMAP = .false.
126130
jpl_height = .false.
@@ -130,6 +134,7 @@ SUBROUTINE init_bcs_config (LBCSV)
130134
SOILBCS = 'HWSD'
131135
MODALB = 'MODIS2'
132136
SNOWALB = 'LUT'
137+
OUTLETV = "N/A"
133138
GNU = 1.0
134139
use_PEATMAP = .false.
135140
jpl_height = .true.
@@ -139,6 +144,7 @@ SUBROUTINE init_bcs_config (LBCSV)
139144
SOILBCS = 'HWSD'
140145
MODALB = 'MODIS2'
141146
SNOWALB = 'LUT'
147+
OUTLETV = "N/A"
142148
GNU = 1.0
143149
use_PEATMAP = .true.
144150
jpl_height = .true.
@@ -148,6 +154,7 @@ SUBROUTINE init_bcs_config (LBCSV)
148154
SOILBCS = 'HWSD'
149155
MODALB = 'MODIS2'
150156
SNOWALB = 'MODC061'
157+
OUTLETV = "N/A"
151158
GNU = 1.0
152159
use_PEATMAP = .true.
153160
jpl_height = .true.
@@ -157,6 +164,7 @@ SUBROUTINE init_bcs_config (LBCSV)
157164
SOILBCS = 'HWSD'
158165
MODALB = 'MODIS2'
159166
SNOWALB = 'LUT'
167+
OUTLETV = "N/A"
160168
GNU = 1.0
161169
use_PEATMAP = .true.
162170
jpl_height = .false.
@@ -166,6 +174,7 @@ SUBROUTINE init_bcs_config (LBCSV)
166174
SOILBCS = 'HWSD'
167175
MODALB = 'MODIS2'
168176
SNOWALB = 'MODC061'
177+
OUTLETV = "N/A"
169178
GNU = 1.0
170179
use_PEATMAP = .false.
171180
jpl_height = .false.
@@ -175,6 +184,7 @@ SUBROUTINE init_bcs_config (LBCSV)
175184
SOILBCS = 'HWSD'
176185
MODALB = 'MODIS2'
177186
SNOWALB = 'MODC061'
187+
OUTLETV = "N/A"
178188
GNU = 1.0
179189
use_PEATMAP = .true.
180190
jpl_height = .false.
@@ -184,6 +194,7 @@ SUBROUTINE init_bcs_config (LBCSV)
184194
SOILBCS = 'HWSD'
185195
MODALB = 'MODIS2'
186196
SNOWALB = 'MODC061v2'
197+
OUTLETV = "N/A"
187198
GNU = 1.0
188199
use_PEATMAP = .true.
189200
jpl_height = .false.
@@ -193,6 +204,7 @@ SUBROUTINE init_bcs_config (LBCSV)
193204
SOILBCS = 'HWSD'
194205
MODALB = 'MODIS2'
195206
SNOWALB = 'MODC061v2'
207+
OUTLETV = "v1"
196208
GNU = 1.0
197209
use_PEATMAP = .true.
198210
jpl_height = .true.
@@ -202,6 +214,7 @@ SUBROUTINE init_bcs_config (LBCSV)
202214
SOILBCS = 'HWSD_b'
203215
MODALB = 'MODIS2'
204216
SNOWALB = 'MODC061v2'
217+
OUTLETV = "v2"
205218
GNU = 1.0
206219
use_PEATMAP = .true.
207220
jpl_height = .true.

0 commit comments

Comments
 (0)