@@ -4,10 +4,11 @@ program mk_runofftbl
44!
55! !ARGUMENTS:
66!
7- ! Usage = "mk_runofftbl.x -g Gridname"
7+ ! Usage = "mk_runofftbl.x -g Gridname -v LBCSV "
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, ...)
1112!
1213! This program generates the runoff table *.trn and *.TRN files that are used in the Catchment model for
1314! directing runoff to its ocean sink. The inputs are (i) bcs geometry files associated with the Gridname
@@ -32,7 +33,7 @@ program mk_runofftbl
3233
3334 use mapl_hashmod
3435 use mapl_sortmod
35- use rmTinyCatchParaMod, only :: OUTLETV
36+ use rmTinyCatchParaMod, only : init_bcs_config, OUTLETV
3637 use netcdf
3738
3839 implicit none
@@ -57,18 +58,12 @@ program mk_runofftbl
5758 integer :: nxt, command_argument_count
5859 character * (128 ) :: arg
5960 character * (128 ) :: Usage = " mk_runofftbl.x -g CF0180x6C_M6TP0072x0036-Pfafstetter -v v12"
61+ character * 5 :: LBCSV = ' UNDEF'
6062 character * 1 :: opt
6163
6264 ! ------------------------------------------------------------------
6365
6466 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
7267
7368 ! Read inputs -----------------------------------------------------
7469
@@ -96,6 +91,9 @@ program mk_runofftbl
9691 select case (opt)
9792 case (' g' )
9893 Gridname = trim (arg)
94+ case (' v' )
95+ LBCSV = trim (arg)
96+ call init_bcs_config (trim (LBCSV)) ! get bcs details from version string
9997 case default
10098 print * , " Wrong flag -" , opt
10199 print * , " Example usage with defaults: "
@@ -106,8 +104,12 @@ program mk_runofftbl
106104 call get_command_argument(nxt,arg)
107105 end do
108106
109- print * , " "
110- print * , " Working with input BCs grid: " , trim (Gridname)
107+ if (trim (OUTLETV)==" v1" .or. trim (OUTLETV)==" v2" )then
108+ fileLL= trim (MAKE_BCS_INPUT_DIR)// ' /land/route/' // trim (OUTLETV)// ' /Outlet_latlon.'
109+ else
110+ print * , " Routing files will not be produced with the selected land BCs version"
111+ stop
112+ endif
111113
112114 ! ------------------------------------------------------------------
113115
0 commit comments