@@ -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
32313332
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
0 commit comments