File indexing completed on 2023-10-07 05:10:33 UTC
view on githubraw file Latest commit 4d722833 on 2023-10-06 20:00:24 UTC
7bfe6112e8 Jean*0001 #include "CTRL_OPTIONS.h"
57c22ecc45 Jean*0002 #include "AD_CONFIG.h"
cf705a6c8e Mart*0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 SUBROUTINE CTRL_READPARMS( myThid )
0014
0015
0016
0017
0018
0019
0020
0021 IMPLICIT NONE
0022
0023
042be14492 Patr*0024 #include "EEPARAMS.h"
0025 #include "SIZE.h"
0026 #include "PARAMS.h"
61a813cf9a Gael*0027 #ifdef ALLOW_CTRL
0028 # include "CTRL_SIZE.h"
4d72283393 Mart*0029 # include "CTRL.h"
61a813cf9a Gael*0030 # include "CTRL_GENARR.h"
0031 # include "CTRL_OBCS.h"
cf705a6c8e Mart*0032 # include "ctrl_local_params.h"
61a813cf9a Gael*0033 #endif
a5904a1bbe Gael*0034 #ifdef ALLOW_AUTODIFF
0035 #include "AUTODIFF_PARAMS.h"
0036 #endif
042be14492 Patr*0037
cf705a6c8e Mart*0038
0039 INTEGER myThid
042be14492 Patr*0040
f9d7cbfb72 Ou W*0041
0042 INTEGER ILNBLNK
0043 EXTERNAL ILNBLNK
0044
cf705a6c8e Mart*0045
0046 INTEGER iUnit
0047 INTEGER nRetired
0048 CHARACTER*(MAX_LEN_MBUF) msgBuf
02585d30f9 Gael*0049 #if (defined (ALLOW_GENARR2D_CONTROL) || defined (ALLOW_GENARR3D_CONTROL) || defined (ALLOW_GENTIM2D_CONTROL))
cf705a6c8e Mart*0050 INTEGER iarr,jarr
02585d30f9 Gael*0051 #endif
f9d7cbfb72 Ou W*0052 CHARACTER*(MAX_LEN_FNAM) namBuf
0053 INTEGER IL
0054 #ifdef HAVE_SYSTEM
0055 INTEGER pIL
0056 #endif
cf705a6c8e Mart*0057
0058 LOGICAL ctrlUseGen
0059 LOGICAL ctrlSmoothCorrel3D
0060 LOGICAL ctrlSmoothCorrel2D
0061
0062
0063
0064 NAMELIST /CTRL_NML/
983e72444d Patr*0065 & xx_theta_file, xx_salt_file,
0066 & xx_hflux_file, xx_hflux_remo_intercept, xx_hflux_remo_slope,
042be14492 Patr*0067 & xx_hfluxstartdate1, xx_hfluxstartdate2, xx_hfluxperiod,
983e72444d Patr*0068 & xx_sflux_file, xx_sflux_remo_intercept, xx_sflux_remo_slope,
042be14492 Patr*0069 & xx_sfluxstartdate1, xx_sfluxstartdate2, xx_sfluxperiod,
983e72444d Patr*0070 & xx_tauu_file, xx_tauu_remo_intercept, xx_tauu_remo_slope,
042be14492 Patr*0071 & xx_tauustartdate1, xx_tauustartdate2, xx_tauuperiod,
983e72444d Patr*0072 & xx_tauv_file, xx_tauv_remo_intercept, xx_tauv_remo_slope,
042be14492 Patr*0073 & xx_tauvstartdate1, xx_tauvstartdate2, xx_tauvperiod,
983e72444d Patr*0074 & xx_atemp_file, xx_atemp_remo_intercept, xx_atemp_remo_slope,
042be14492 Patr*0075 & xx_atempstartdate1, xx_atempstartdate2, xx_atempperiod,
983e72444d Patr*0076 & xx_aqh_file, xx_aqh_remo_intercept, xx_aqh_remo_slope,
042be14492 Patr*0077 & xx_aqhstartdate1, xx_aqhstartdate2, xx_aqhperiod,
983e72444d Patr*0078 & xx_precip_file, xx_precip_remo_intercept, xx_precip_remo_slope,
9ab1d0672d Patr*0079 & xx_precipstartdate1, xx_precipstartdate2, xx_precipperiod,
983e72444d Patr*0080 & xx_swflux_file, xx_swflux_remo_intercept, xx_swflux_remo_slope,
5ceb56546e Patr*0081 & xx_swfluxstartdate1, xx_swfluxstartdate2, xx_swfluxperiod,
983e72444d Patr*0082 & xx_swdown_file, xx_swdown_remo_intercept, xx_swdown_remo_slope,
02568c8633 Patr*0083 & xx_swdownstartdate1, xx_swdownstartdate2, xx_swdownperiod,
983e72444d Patr*0084 & xx_lwflux_file, xx_lwflux_remo_intercept, xx_lwflux_remo_slope,
0085 & xx_lwfluxstartdate1, xx_lwfluxstartdate2, xx_lwfluxperiod,
0086 & xx_lwdown_file, xx_lwdown_remo_intercept, xx_lwdown_remo_slope,
0087 & xx_lwdownstartdate1, xx_lwdownstartdate2, xx_lwdownperiod,
0088 & xx_evap_file, xx_evap_remo_intercept, xx_evap_remo_slope,
0089 & xx_evapstartdate1, xx_evapstartdate2, xx_evapperiod,
7ef594fa1c Jean*0090 & xx_snowprecip_file, xx_snowprecip_remo_intercept,
983e72444d Patr*0091 & xx_snowprecip_remo_slope, xx_snowprecipperiod,
0092 & xx_snowprecipstartdate1, xx_snowprecipstartdate2,
7ef594fa1c Jean*0093 & xx_apressure_file, xx_apressure_remo_intercept,
983e72444d Patr*0094 & xx_apressure_remo_slope, xx_apressureperiod,
0095 & xx_apressurestartdate1, xx_apressurestartdate2,
0096 & xx_runoff_file, xx_runoff_remo_intercept, xx_runoff_remo_slope,
0097 & xx_runoffstartdate1, xx_runoffstartdate2, xx_runoffperiod,
0098 & xx_uwind_file, xx_uwind_remo_intercept, xx_uwind_remo_slope,
042be14492 Patr*0099 & xx_uwindstartdate1, xx_uwindstartdate2, xx_uwindperiod,
983e72444d Patr*0100 & xx_vwind_file, xx_vwind_remo_intercept, xx_vwind_remo_slope,
042be14492 Patr*0101 & xx_vwindstartdate1, xx_vwindstartdate2, xx_vwindperiod,
bc12ca2c8b Patr*0102 & xx_aqh_mean_file, xx_atemp_mean_file, xx_precip_mean_file,
0103 & xx_swdown_mean_file, xx_uwind_mean_file, xx_vwind_mean_file,
042be14492 Patr*0104 & xx_obcsn_file,
0105 & xx_obcsnstartdate1, xx_obcsnstartdate2, xx_obcsnperiod,
0106 & xx_obcss_file,
0107 & xx_obcssstartdate1, xx_obcssstartdate2, xx_obcssperiod,
0108 & xx_obcsw_file,
0109 & xx_obcswstartdate1, xx_obcswstartdate2, xx_obcswperiod,
0110 & xx_obcse_file,
0111 & xx_obcsestartdate1, xx_obcsestartdate2, xx_obcseperiod,
7e2482cabc Gael*0112 & xx_diffkr_file, xx_kapgm_file, xx_kapredi_file, xx_tr1_file,
b142f4a690 Patr*0113 & xx_sst_file, xx_sst_remo_intercept, xx_sst_remo_slope,
0114 & xx_sss_file, xx_sss_remo_intercept, xx_sss_remo_slope,
103f30c840 Patr*0115 & xx_sststartdate1, xx_sststartdate2, xx_sstperiod,
0116 & xx_sssstartdate1, xx_sssstartdate2, xx_sssperiod,
7bfe6112e8 Jean*0117 & xx_depth_file, xx_gen2d_file, xx_gen3d_file,
ffe95b3b07 Patr*0118 & xx_efluxy_file, xx_efluxp_file, xx_bottomdrag_file,
983e72444d Patr*0119 & xx_edtaux_file, xx_edtauy_file,
0120 & xx_uvel_file, xx_vvel_file, xx_etan_file,
784bc8f884 Patr*0121 & xx_siarea_file, xx_siheff_file, xx_sihsnow_file,
7ef594fa1c Jean*0122 & xx_shifwflx_file,
0123 & xx_shifwflx_remo_intercept, xx_shifwflx_remo_slope,
1d82288286 Mart*0124 & xx_shifwflxstartdate1, xx_shifwflxstartdate2, xx_shifwflxperiod,
b6f5c14800 Gael*0125 & doInitXX, ctrlSmoothCorrel3D, ctrlSmoothCorrel2D, ctrlUseGen,
b052f6c8f1 Patr*0126 & doPackDiag,
983e72444d Patr*0127 & doZscaleUnpack, doZscalePack,
0128 & doMainUnpack, doMainPack,
516917913e Patr*0129 & doSinglePrecTapelev,
ca0df8acbf Patr*0130 & doAdmtlmBypassAD,
f9d7cbfb72 Ou W*0131 & delZexp, forcingPrecond, ctrlprec, ctrlDir
798126c2ad Davi*0132
0133 & ,xx_hfluxm_file
0134
042be14492 Patr*0135
cf705a6c8e Mart*0136 NAMELIST /CTRL_PACKNAMES/
d04f98ba8f Patr*0137 & yadmark, yctrlid, yctrlposunpack, yctrlpospack,
042be14492 Patr*0138 & ctrlname, costname, scalname, maskname, metaname
0139
7bd66d7dc3 Patr*0140 #if (defined (ALLOW_GENARR2D_CONTROL) || defined (ALLOW_GENARR3D_CONTROL) || defined (ALLOW_GENTIM2D_CONTROL))
cf705a6c8e Mart*0141 NAMELIST /CTRL_NML_GENARR/
7bd66d7dc3 Patr*0142 & xx_genarr2d_file, xx_genarr3d_file, xx_gentim2d_file,
3145d51f22 Patr*0143 & xx_genarr2d_weight, xx_genarr3d_weight, xx_gentim2d_weight,
bd00ac563a Gael*0144 & xx_genarr2d_bounds, xx_genarr3d_bounds, xx_gentim2d_bounds,
513e004a84 Gael*0145 & genarr2dPrecond, genarr3dPrecond, gentim2dPrecond,
0146 & mult_gentim2d,mult_genarr2d,mult_genarr3d,
0147 & xx_genarr2d_preproc, xx_genarr2d_preproc_i,
0148 & xx_genarr2d_preproc_r, xx_genarr2d_preproc_c,
0149 & xx_genarr3d_preproc, xx_genarr3d_preproc_i,
0150 & xx_genarr3d_preproc_r, xx_genarr3d_preproc_c,
0151 & xx_gentim2d_preproc, xx_gentim2d_preproc_i,
0152 & xx_gentim2d_preproc_r, xx_gentim2d_preproc_c,
9bf17fb3ed Gael*0153 & xx_gentim2d_period,
7bd66d7dc3 Patr*0154 & xx_gentim2d_startdate1, xx_gentim2d_startdate2,
513e004a84 Gael*0155 & xx_gentim2d_cumsum,xx_gentim2d_glosum
7bd66d7dc3 Patr*0156 #endif
0157
219393e304 Gael*0158 IF ( .NOT.useCTRL ) THEN
0159
0160 _BEGIN_MASTER(myThid)
0161
0162
0163 CALL PACKAGES_UNUSED_MSG( 'useCTRL', ' ', ' ' )
0164 _END_MASTER(myThid)
0165 RETURN
0166 ENDIF
0167
042be14492 Patr*0168 _BEGIN_MASTER( myThid )
0169
cf705a6c8e Mart*0170
8f0b59c61c Patr*0171 doInitXX = .TRUE.
456bf2eff2 Jean*0172 #ifdef ALLOW_SMOOTH_CORREL3D
439bdb021f Gael*0173 ctrlSmoothCorrel3D = .TRUE.
0174 #else
0175 ctrlSmoothCorrel3D = .FALSE.
0176 #endif
456bf2eff2 Jean*0177 #ifdef ALLOW_SMOOTH_CORREL2D
439bdb021f Gael*0178 ctrlSmoothCorrel2D = .TRUE.
0179 #else
0180 ctrlSmoothCorrel2D = .FALSE.
0181 #endif
b6f5c14800 Gael*0182 ctrlUseGen = .TRUE.
8f0b59c61c Patr*0183 #ifdef ALLOW_ADMTLM
0184 doAdmTlm = .TRUE.
0185 #else
0186 doAdmTlm = .FALSE.
0187 #endif
0ba65c94ff Patr*0188 doPackDiag = .FALSE.
b052f6c8f1 Patr*0189 doZscaleUnpack = .FALSE.
0190 doZscalePack = .FALSE.
f8659cb5d2 Patr*0191 doMainUnpack = .TRUE.
f29f3cc477 Jean*0192 #if (defined (ALLOW_ADJOINT_RUN)||defined (ALLOW_TANGENTLINEAR_RUN))
f8659cb5d2 Patr*0193 doMainPack = .TRUE.
456bf2eff2 Jean*0194 #else
0195 doMainPack = .FALSE.
0196 #endif
516917913e Patr*0197 doSinglePrecTapelev = .FALSE.
8a10dfc8f1 Patr*0198 doAdmtlmBypassAD = .FALSE.
8f0b59c61c Patr*0199
ca0df8acbf Patr*0200 delZexp = 0.
3a2820aa92 Gael*0201 forcingPrecond = 1. _d 0
ca0df8acbf Patr*0202
6b47d550f4 Mart*0203 #ifdef CTRL_SET_PREC_32
0204
0205
0206 ctrlprec = 32
0207 #else
0208 ctrlprec = 64
0209 #endif
0210
f9d7cbfb72 Ou W*0211 ctrlDir = ' '
0212
8f901f15d1 Patr*0213 xx_theta_file = 'xx_theta'
0214 xx_salt_file = 'xx_salt'
cf705a6c8e Mart*0215
e936cea1a6 Patr*0216 xx_gen2d_file = 'xx_gen2d'
0217 xx_gen3d_file = 'xx_gen3d'
7bd66d7dc3 Patr*0218
0219 #if (defined (ALLOW_GENARR2D_CONTROL) || defined (ALLOW_GENARR3D_CONTROL) || defined (ALLOW_GENTIM2D_CONTROL))
ffe95b3b07 Patr*0220 do iarr = 1, maxCtrlArr2D
954f010844 Gael*0221 write(xx_genarr2d_file(iarr)(1:MAX_LEN_FNAM),'(a)') ' '
0222 #ifdef ALLOW_OPENAD
ffe95b3b07 Patr*0223 write(xx_genarr2d_file(iarr)(1:14),'(a,i2.2)')
0224 & 'xx_genarr2d_', iarr
0225 write(xx_genarr2d_file(iarr)(15:MAX_LEN_FNAM),'(a)') ' '
954f010844 Gael*0226 #endif
3145d51f22 Patr*0227 write(xx_genarr2d_weight(iarr)(1:MAX_LEN_FNAM),'(a)') ' '
6b47d550f4 Mart*0228 genarr2dPrecond(iarr) = 1. _d 0
0229 mult_genarr2d(iarr) = 1. _d 0
02585d30f9 Gael*0230 do jarr = 1, 5
0231 xx_genarr2d_bounds(jarr,iarr) = 0. _d 0
0232 enddo
513e004a84 Gael*0233 do jarr=1,maxCtrlProc
0234 xx_genarr2d_preproc(jarr,iarr) = ' '
0235 xx_genarr2d_preproc_c(jarr,iarr) = ' '
0236 xx_genarr2d_preproc_i(jarr,iarr) = 0
0237 xx_genarr2d_preproc_r(jarr,iarr) = 0. _d 0
0238 enddo
ffe95b3b07 Patr*0239 enddo
cf705a6c8e Mart*0240
ffe95b3b07 Patr*0241 do iarr = 1, maxCtrlArr3D
954f010844 Gael*0242 write(xx_genarr3d_file(iarr)(1:MAX_LEN_FNAM),'(a)') ' '
0243 #ifdef ALLOW_OPENAD
ffe95b3b07 Patr*0244 write(xx_genarr3d_file(iarr)(1:14),'(a,i2.2)')
0245 & 'xx_genarr3d_', iarr
0246 write(xx_genarr3d_file(iarr)(15:MAX_LEN_FNAM),'(a)') ' '
954f010844 Gael*0247 #endif
3145d51f22 Patr*0248 write(xx_genarr3d_weight(iarr)(1:MAX_LEN_FNAM),'(a)') ' '
6b47d550f4 Mart*0249 genarr3dPrecond(iarr) = 1. _d 0
0250 mult_genarr3d(iarr) = 1. _d 0
02585d30f9 Gael*0251 do jarr = 1, 5
0252 xx_genarr3d_bounds(jarr,iarr) = 0. _d 0
0253 enddo
513e004a84 Gael*0254 do jarr=1,maxCtrlProc
0255 xx_genarr3d_preproc(jarr,iarr) = ' '
0256 xx_genarr3d_preproc_c(jarr,iarr) = ' '
0257 xx_genarr3d_preproc_i(jarr,iarr) = 0
0258 xx_genarr3d_preproc_r(jarr,iarr) = 0. _d 0
0259 enddo
ffe95b3b07 Patr*0260 enddo
cf705a6c8e Mart*0261
7bd66d7dc3 Patr*0262 do iarr = 1, maxCtrlTim2D
954f010844 Gael*0263 write(xx_gentim2d_file(iarr)(1:MAX_LEN_FNAM),'(a)') ' '
0264 #ifdef ALLOW_OPENAD
7bd66d7dc3 Patr*0265 write(xx_gentim2d_file(iarr)(1:14),'(a,i2.2)')
0266 & 'xx_gentim2d_', iarr
0267 write(xx_gentim2d_file(iarr)(15:MAX_LEN_FNAM),'(a)') ' '
954f010844 Gael*0268 #endif
3145d51f22 Patr*0269 write(xx_gentim2d_weight(iarr)(1:MAX_LEN_FNAM),'(a)') ' '
0270 xx_gentim2d_startdate1(iarr) = 0
0271 xx_gentim2d_startdate2(iarr) = 0
0272 xx_gentim2d_period(iarr) = 0. _d 0
a87570e2e8 Gael*0273 xx_gentim2d_cumsum(iarr) = .FALSE.
0274 xx_gentim2d_glosum(iarr) = .FALSE.
513e004a84 Gael*0275 do jarr=1,maxCtrlProc
0276 xx_gentim2d_preproc(jarr,iarr) = ' '
0277 xx_gentim2d_preproc_c(jarr,iarr) = ' '
0278 xx_gentim2d_preproc_i(jarr,iarr) = 0
0279 xx_gentim2d_preproc_r(jarr,iarr) = 0. _d 0
0280 enddo
dddb891da6 Gael*0281 mult_gentim2d(iarr) = 1. _d 0
ea1c7c7217 Gael*0282 gentim2dPrecond(iarr) = 1. _d 0
bd00ac563a Gael*0283 do jarr = 1, 5
0284 xx_gentim2d_bounds(jarr,iarr) = 0. _d 0
0285 enddo
7bd66d7dc3 Patr*0286 enddo
0287 #endif
cf705a6c8e Mart*0288
042be14492 Patr*0289 xx_obcsnstartdate1 = 0
0290 xx_obcsnstartdate2 = 0
0291 xx_obcsnperiod = 0. _d 0
8f901f15d1 Patr*0292 xx_obcsn_file = 'xx_obcsn'
cf705a6c8e Mart*0293
042be14492 Patr*0294 xx_obcssstartdate1 = 0
0295 xx_obcssstartdate2 = 0
0296 xx_obcssperiod = 0. _d 0
8f901f15d1 Patr*0297 xx_obcss_file = 'xx_obcss'
cf705a6c8e Mart*0298
042be14492 Patr*0299 xx_obcswstartdate1 = 0
0300 xx_obcswstartdate2 = 0
0301 xx_obcswperiod = 0. _d 0
8f901f15d1 Patr*0302 xx_obcsw_file = 'xx_obcsw'
cf705a6c8e Mart*0303
042be14492 Patr*0304 xx_obcsestartdate1 = 0
0305 xx_obcsestartdate2 = 0
0306 xx_obcseperiod = 0. _d 0
8f901f15d1 Patr*0307 xx_obcse_file = 'xx_obcse'
cf705a6c8e Mart*0308
0309
0310
0311 CALL CTRL_SET_RETIRED_PARMS(xx_hfluxstartdate1,
0312 I xx_hfluxstartdate2, xx_hfluxperiod, xx_hflux_file,
0313 I xx_hflux_file, xx_hflux_remo_intercept,
0314 I xx_hflux_remo_slope , myThid )
0315 CALL CTRL_SET_RETIRED_PARMS(xx_sfluxstartdate1,
0316 I xx_sfluxstartdate2, xx_sfluxperiod, xx_sflux_file,
0317 I xx_sflux_file, xx_sflux_remo_intercept,
0318 I xx_sflux_remo_slope, myThid )
0319 CALL CTRL_SET_RETIRED_PARMS(xx_tauustartdate1,xx_tauustartdate2,
0320 I xx_tauuperiod, xx_tauu_file, xx_tauu_file,
0321 I xx_tauu_remo_intercept, xx_tauu_remo_slope, myThid )
0322 CALL CTRL_SET_RETIRED_PARMS(xx_tauvstartdate1,xx_tauvstartdate2,
0323 I xx_tauvperiod, xx_tauv_file, xx_tauv_file,
0324 I xx_tauv_remo_intercept, xx_tauv_remo_slope, myThid )
0325 CALL CTRL_SET_RETIRED_PARMS(xx_atempstartdate1,
0326 I xx_atempstartdate2, xx_atempperiod, xx_atemp_file,
0327 I xx_atemp_mean_file, xx_atemp_remo_intercept,
0328 I xx_atemp_remo_slope, myThid )
0329 CALL CTRL_SET_RETIRED_PARMS(xx_aqhstartdate1, xx_aqhstartdate2,
0330 I xx_aqhperiod, xx_aqh_file, xx_aqh_mean_file,
0331 I xx_aqh_remo_intercept, xx_aqh_remo_slope, myThid )
0332 CALL CTRL_SET_RETIRED_PARMS(xx_precipstartdate1,
0333 I xx_precipstartdate2, xx_precipperiod, xx_precip_file,
0334 I xx_precip_mean_file, xx_precip_remo_intercept,
0335 I xx_precip_remo_slope, myThid )
0336 CALL CTRL_SET_RETIRED_PARMS(xx_sfluxstartdate1,
0337 I xx_sfluxstartdate2, xx_sfluxperiod, xx_sflux_file,
0338 I xx_sflux_file, xx_sflux_remo_intercept,xx_sflux_remo_slope,
0339 I myThid )
0340 CALL CTRL_SET_RETIRED_PARMS(xx_swdownstartdate1,
0341 I xx_swdownstartdate2, xx_swdownperiod, xx_swdown_file,
0342 I xx_swdown_mean_file, xx_swdown_remo_intercept,
0343 I xx_swdown_remo_slope, myThid )
0344 CALL CTRL_SET_RETIRED_PARMS(xx_lwfluxstartdate1,
0345 I xx_lwfluxstartdate2, xx_lwfluxperiod, xx_lwflux_file,
0346 I xx_lwflux_file, xx_lwflux_remo_intercept,
0347 I xx_lwflux_remo_slope, myThid )
0348 CALL CTRL_SET_RETIRED_PARMS(xx_lwdownstartdate1,
0349 I xx_lwdownstartdate2, xx_lwdownperiod, xx_lwdown_file,
0350 I xx_lwdown_file, xx_lwdown_remo_intercept,
0351 I xx_lwdown_remo_slope, myThid )
0352 CALL CTRL_SET_RETIRED_PARMS(xx_evapstartdate1,xx_evapstartdate2,
0353 I xx_evapperiod, xx_evap_file, xx_evap_file,
0354 I xx_evap_remo_intercept, xx_evap_remo_slope, myThid )
0355 CALL CTRL_SET_RETIRED_PARMS(xx_snowprecipstartdate1,
0356 I xx_snowprecipstartdate2, xx_snowprecipperiod,
0357 I xx_snowprecip_file, xx_snowprecip_file,
0358 I xx_snowprecip_remo_intercept, xx_snowprecip_remo_slope,
0359 I myThid )
0360 CALL CTRL_SET_RETIRED_PARMS(xx_apressurestartdate1,
0361 I xx_apressurestartdate2, xx_apressureperiod,
0362 I xx_apressure_file, xx_apressure_file,
0363 I xx_apressure_remo_intercept, xx_apressure_remo_slope,
0364 I myThid )
0365 CALL CTRL_SET_RETIRED_PARMS(xx_runoffstartdate1,
0366 I xx_runoffstartdate2, xx_runoffperiod, xx_runoff_file,
0367 I xx_runoff_file, xx_runoff_remo_intercept,
0368 I xx_runoff_remo_slope, myThid )
0369 CALL CTRL_SET_RETIRED_PARMS(xx_uwindstartdate1,
0370 I xx_uwindstartdate2, xx_uwindperiod, xx_uwind_file,
0371 I xx_uwind_file, xx_uwind_remo_intercept,xx_uwind_remo_slope,
0372 I myThid )
0373 CALL CTRL_SET_RETIRED_PARMS(xx_vwindstartdate1,
0374 I xx_vwindstartdate2, xx_vwindperiod, xx_vwind_file,
0375 I xx_vwind_file, xx_vwind_remo_intercept,xx_vwind_remo_slope,
0376 I myThid )
0377 CALL CTRL_SET_RETIRED_PARMS(xx_sststartdate1, xx_sststartdate2,
0378 I xx_sstperiod, xx_sst_file, xx_sst_file,
0379 I xx_sst_remo_intercept, xx_sst_remo_slope, myThid )
0380 CALL CTRL_SET_RETIRED_PARMS(xx_sssstartdate1, xx_sssstartdate2,
0381 I xx_sssperiod, xx_sss_file, xx_sss_file,
0382 I xx_sss_remo_intercept, xx_sss_remo_slope, myThid )
0383 CALL CTRL_SET_RETIRED_PARMS(xx_shifwflxstartdate1,
0384 I xx_shifwflxstartdate2, xx_shifwflxperiod, xx_shifwflx_file,
0385 I xx_shifwflx_file, xx_shifwflx_remo_intercept,
0386 I xx_shifwflx_remo_slope, myThid )
0387
0388 xx_diffkr_file = ' '
0389 xx_kapgm_file = ' '
0390 xx_kapredi_file = ' '
0391 xx_tr1_file = ' '
0392 xx_depth_file = ' '
0393 xx_efluxy_file = ' '
0394 xx_efluxp_file = ' '
0395 xx_bottomdrag_file = ' '
0396 xx_edtaux_file = ' '
0397 xx_edtauy_file = ' '
0398 xx_uvel_file = ' '
0399 xx_vvel_file = ' '
0400 xx_etan_file = ' '
0401 xx_siarea_file = ' '
0402 xx_siheff_file = ' '
0403 xx_sihsnow_file = ' '
798126c2ad Davi*0404
cf705a6c8e Mart*0405 xx_hfluxm_file = ' '
798126c2ad Davi*0406
cf705a6c8e Mart*0407
042be14492 Patr*0408
9eb96e5404 Patr*0409 #ifdef ALLOW_TANGENTLINEAR_RUN
0410 yadprefix = 'g_'
042be14492 Patr*0411 yadmark = 'g_'
9eb96e5404 Patr*0412 #else
0413 yadprefix = 'ad'
0414 yadmark = 'ad'
042be14492 Patr*0415 #endif
0416 yctrlid = 'MIT_CE_000'
d04f98ba8f Patr*0417 yctrlposunpack = '.opt'
0418 yctrlpospack = '.opt'
214a1cd575 Patr*0419 ctrlname = 'ecco_ctrl'
0420 costname = 'ecco_cost'
042be14492 Patr*0421 scalname = ' '
0422 maskname = ' '
0423 metaname = ' '
0424
cf705a6c8e Mart*0425
9aaf43452b Patr*0426 WRITE(msgBuf,'(A)') 'CTRL_READPARMS: opening data.ctrl'
0427 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0428 & SQUEEZE_RIGHT , 1)
0429
0430 CALL OPEN_COPY_DATA_FILE(
0431 I 'data.ctrl', 'CTRL_READPARMS',
0432 O iUnit,
0433 I myThid )
0434
0435 READ(unit = iUnit, nml = ctrl_nml)
0436 READ(unit = iUnit, nml = ctrl_packnames)
7bd66d7dc3 Patr*0437 #if (defined (ALLOW_GENARR2D_CONTROL) || defined (ALLOW_GENARR3D_CONTROL) || defined (ALLOW_GENTIM2D_CONTROL))
0438 READ(unit = iUnit, nml = ctrl_nml_genarr)
0439 #endif
9aaf43452b Patr*0440
7ef594fa1c Jean*0441 WRITE(msgBuf,'(A)')
9aaf43452b Patr*0442 & 'CTRL_READPARMS: finished reading data.ctrl'
0443 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0444 & SQUEEZE_RIGHT , 1)
0445
7a77863887 Mart*0446 #ifdef SINGLE_DISK_IO
0447 CLOSE(iUnit)
0448 #else
0449 CLOSE(iUnit,STATUS='DELETE')
0450 #endif /* SINGLE_DISK_IO */
042be14492 Patr*0451
f9d7cbfb72 Ou W*0452
0453 IF ( ctrlDir .NE. ' ' ) THEN
0454 IL = ILNBLNK( ctrlDir )
0455
0456 IF ( IL.LT.MAX_LEN_FNAM .AND. ctrlDir(IL:IL).NE.'/' ) THEN
0457 namBuf(1:IL) = ctrlDir(1:IL)
0458 WRITE(ctrlDir(1:IL+1),'(2A)') namBuf(1:IL),'/'
0459 ENDIF
0460 #ifdef HAVE_SYSTEM
0461
0462 IL = ILNBLNK( ctrlDir ) -1
0463 WRITE(namBuf,'(2A)') ' mkdir -p ', ctrlDir(1:IL)
0464 pIL = 1 + ILNBLNK( namBuf )
0465 WRITE(standardMessageUnit,'(3A)')
0466 & '==> SYSTEM CALL (from CTRL_READPARMS): >',
0467 & namBuf(1:pIL), '<'
0468 CALL SYSTEM( namBuf(1:pIL) )
0469 #else
0470 WRITE(msgBuf,'(2A)') '** WARNING ** CTRL_READPARMS: ',
0471 & 'cannot call mkdir -> please create ctrlDir manually'
0472 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0473 & SQUEEZE_RIGHT, myThid )
0474 #endif
0475 ENDIF
0476
0477 IF (ctrlDir .NE. ' ') THEN
0478 WRITE(msgBuf,'(2A)')
0479 & 'read-write ctrl files from ', ctrlDir(1:IL)
0480 ELSE
0481 WRITE(msgBuf,'(A)')
0482 & 'read-write ctrl files from current run directory'
0483 ENDIF
0484 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
0485 & SQUEEZE_RIGHT, myThid )
0486
0487
cf705a6c8e Mart*0488 nRetired = 0
0489 IF ( ctrlSmoothCorrel2D ) THEN
0490 WRITE(msgBuf,'(2A)') 'S/R CTRL_READPARMS: ',
0491 & 'ctrlSmoothCorrel2D no longer allowed in file "data.ctrl"'
0492 CALL PRINT_ERROR( msgBuf, myThid )
0493 #ifdef ALLOW_SMOOTH_CORREL2D
0494 WRITE(msgBuf,'(2A)') 'S/R CTRL_READPARMS: ',
0495 & ' nor is ALLOW_SMOOTH_CORREL2D allowed to be defined.'
0496 CALL PRINT_ERROR( msgBuf, myThid )
0497 #endif
0498 WRITE(msgBuf,'(A)')
0499 & 'S/R CTRL_READPARMS: Please use the smooth-pkg instead'
0500 CALL PRINT_ERROR( msgBuf, myThid )
0501 nRetired = nRetired + 1
0502 ENDIF
0503 IF ( ctrlSmoothCorrel3D ) THEN
0504 WRITE(msgBuf,'(2A)') 'S/R CTRL_READPARMS: ',
0505 & 'ctrlSmoothCorrel3D no longer allowed in file "data.ctrl"'
0506 CALL PRINT_ERROR( msgBuf, myThid )
0507 #ifdef ALLOW_SMOOTH_CORREL3D
0508 WRITE(msgBuf,'(2A)') 'S/R CTRL_READPARMS: ',
0509 & ' nor is ALLOW_SMOOTH_CORREL3D allowed to be defined.'
0510 CALL PRINT_ERROR( msgBuf, myThid )
a5904a1bbe Gael*0511 #endif
cf705a6c8e Mart*0512 WRITE(msgBuf,'(A)')
0513 & 'S/R CTRL_READPARMS: Please use the smooth-pkg instead'
0514 CALL PRINT_ERROR( msgBuf, myThid )
0515 nRetired = nRetired + 1
0516 ENDIF
0517 IF ( .NOT. ctrlUseGen ) THEN
0518 WRITE(msgBuf,'(A,A)')
0519 & 'S/R CTRL_READPARMS: ctrlUseGen',
0520 & ' is no longer allowed in file "data.ctrl"'
0521 CALL PRINT_ERROR( msgBuf, myThid )
0522 nRetired = nRetired + 1
0523 ENDIF
0524 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_hflux',
0525 I xx_hfluxstartdate1, xx_hfluxstartdate2,
0526 I xx_hfluxperiod, xx_hflux_file, ' ',
0527 I xx_hflux_remo_intercept, xx_hflux_remo_slope,
0528 U nRetired,
0529 I myThid )
0530 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_sflux',
0531 I xx_sfluxstartdate1, xx_sfluxstartdate2,
0532 I xx_sfluxperiod, xx_sflux_file, ' ',
0533 I xx_sflux_remo_intercept,xx_sflux_remo_slope,
0534 U nRetired,
0535 I myThid )
0536 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_tauu',
0537 I xx_tauustartdate1, xx_tauustartdate2,
0538 I xx_tauuperiod, xx_tauu_file, ' ',
0539 I xx_tauu_remo_intercept, xx_tauu_remo_slope,
0540 U nRetired,
0541 I myThid )
0542 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_tauv',
0543 I xx_tauvstartdate1,xx_tauvstartdate2,
0544 I xx_tauvperiod, xx_tauv_file, ' ',
0545 I xx_tauv_remo_intercept, xx_tauv_remo_slope,
0546 U nRetired,
0547 I myThid )
0548 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_atemp',
0549 I xx_atempstartdate1, xx_atempstartdate2,
0550 I xx_atempperiod, xx_atemp_file, xx_atemp_mean_file,
0551 I xx_atemp_remo_intercept, xx_atemp_remo_slope,
0552 U nRetired,
0553 I myThid )
0554 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_aqh',
0555 I xx_aqhstartdate1, xx_aqhstartdate2,
0556 I xx_aqhperiod, xx_aqh_file, xx_aqh_mean_file,
0557 I xx_aqh_remo_intercept, xx_aqh_remo_slope,
0558 U nRetired,
0559 I myThid )
0560 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_precip',
0561 I xx_precipstartdate1, xx_precipstartdate2,
0562 I xx_precipperiod, xx_precip_file, xx_precip_mean_file,
0563 I xx_precip_remo_intercept, xx_precip_remo_slope,
0564 U nRetired,
0565 I myThid )
0566 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_sflux',
0567 I xx_sfluxstartdate1, xx_sfluxstartdate2,
0568 I xx_sfluxperiod, xx_sflux_file, ' ',
0569 I xx_sflux_remo_intercept,xx_sflux_remo_slope,
0570 U nRetired,
0571 I myThid )
0572 CALL CTRL_CHECK_RETIRED_PARMS('xx_swdown',
0573 I xx_swdownstartdate1, xx_swdownstartdate2,
0574 I xx_swdownperiod, xx_swdown_file, xx_swdown_mean_file,
0575 I xx_swdown_remo_intercept, xx_swdown_remo_slope,
0576 U nRetired,
0577 I myThid )
0578 CALL CTRL_CHECK_RETIRED_PARMS('xx_lwflux',
0579 I xx_lwfluxstartdate1, xx_lwfluxstartdate2,
0580 I xx_lwfluxperiod, xx_lwflux_file, ' ',
0581 I xx_lwflux_remo_intercept, xx_lwflux_remo_slope,
0582 U nRetired,
0583 I myThid )
0584 CALL CTRL_CHECK_RETIRED_PARMS('xx_lwdown',
0585 I xx_lwdownstartdate1, xx_lwdownstartdate2,
0586 I xx_lwdownperiod, xx_lwdown_file, ' ',
0587 I xx_lwdown_remo_intercept, xx_lwdown_remo_slope,
0588 U nRetired,
0589 I myThid )
0590 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_evap',
0591 I xx_evapstartdate1, xx_evapstartdate2,
0592 I xx_evapperiod, xx_evap_file, ' ',
0593 I xx_evap_remo_intercept, xx_evap_remo_slope,
0594 U nRetired,
0595 I myThid )
0596 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_snowprecip',
0597 I xx_snowprecipstartdate1, xx_snowprecipstartdate2,
0598 I xx_snowprecipperiod, xx_snowprecip_file, ' ',
0599 I xx_snowprecip_remo_intercept, xx_snowprecip_remo_slope,
0600 U nRetired,
0601 I myThid )
0602 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_apressure',
0603 I xx_apressurestartdate1, xx_apressurestartdate2,
0604 I xx_apressureperiod, xx_apressure_file, ' ',
0605 I xx_apressure_remo_intercept, xx_apressure_remo_slope,
0606 U nRetired,
0607 I myThid )
0608 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_runoff',
0609 I xx_runoffstartdate1, xx_runoffstartdate2,
0610 I xx_runoffperiod, xx_runoff_file, ' ',
0611 I xx_runoff_remo_intercept, xx_runoff_remo_slope,
0612 U nRetired,
0613 I myThid )
0614 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_uwind',
0615 I xx_uwindstartdate1, xx_uwindstartdate2,
0616 I xx_uwindperiod, xx_uwind_file, ' ',
0617 I xx_uwind_remo_intercept,xx_uwind_remo_slope,
0618 U nRetired,
0619 I myThid )
0620 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_vwind',
0621 I xx_vwindstartdate1, xx_vwindstartdate2,
0622 I xx_vwindperiod, xx_vwind_file, ' ',
0623 I xx_vwind_remo_intercept,xx_vwind_remo_slope,
0624 U nRetired,
0625 I myThid )
0626 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_sst',
0627 I xx_sststartdate1, xx_sststartdate2,
0628 I xx_sstperiod, xx_sst_file, ' ',
0629 I xx_sst_remo_intercept, xx_sst_remo_slope,
0630 U nRetired,
0631 I myThid )
0632 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_sss',
0633 I xx_sssstartdate1, xx_sssstartdate2,
0634 I xx_sssperiod, xx_sss_file, ' ',
0635 I xx_sss_remo_intercept, xx_sss_remo_slope,
0636 U nRetired,
0637 I myThid )
0638 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_shifwflx',
0639 I xx_shifwflxstartdate1, xx_shifwflxstartdate2,
0640 I xx_shifwflxperiod, xx_shifwflx_file, ' ',
0641 I xx_shifwflx_remo_intercept, xx_shifwflx_remo_slope,
0642 U nRetired,
0643 I myThid )
0644 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_diffkr_file',
0645 I UNSET_I, UNSET_I, UNSET_RL, xx_diffkr_file, ' ',
0646 I UNSET_RL, UNSET_RL,
0647 U nRetired,
0648 I myThid )
0649 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_kapgm_file',
0650 I UNSET_I, UNSET_I, UNSET_RL, xx_kapgm_file, ' ',
0651 I UNSET_RL, UNSET_RL,
0652 U nRetired,
0653 I myThid )
0654 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_kapredi_file',
0655 I UNSET_I, UNSET_I, UNSET_RL, xx_kapredi_file, ' ',
0656 I UNSET_RL, UNSET_RL,
0657 U nRetired,
0658 I myThid )
0659 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_tr1_file',
0660 I UNSET_I, UNSET_I, UNSET_RL, xx_tr1_file, ' ',
0661 I UNSET_RL, UNSET_RL,
0662 U nRetired,
0663 I myThid )
0664 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_depth_file',
0665 I UNSET_I, UNSET_I, UNSET_RL, xx_depth_file, ' ',
0666 I UNSET_RL, UNSET_RL,
0667 U nRetired,
0668 I myThid )
0669 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_efluxy_file',
0670 I UNSET_I, UNSET_I, UNSET_RL, xx_efluxy_file, ' ',
0671 I UNSET_RL, UNSET_RL,
0672 U nRetired,
0673 I myThid )
0674 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_efluxp_file',
0675 I UNSET_I, UNSET_I, UNSET_RL, xx_efluxp_file, ' ',
0676 I UNSET_RL, UNSET_RL,
0677 U nRetired,
0678 I myThid )
0679 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_bottomdrag_file',
0680 I UNSET_I, UNSET_I, UNSET_RL, xx_bottomdrag_file, ' ',
0681 I UNSET_RL, UNSET_RL,
0682 U nRetired,
0683 I myThid )
0684 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_edtaux_file',
0685 I UNSET_I, UNSET_I, UNSET_RL, xx_edtaux_file, ' ',
0686 I UNSET_RL, UNSET_RL,
0687 U nRetired,
0688 I myThid )
0689 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_edtauy_file',
0690 I UNSET_I, UNSET_I, UNSET_RL, xx_edtauy_file, ' ',
0691 I UNSET_RL, UNSET_RL,
0692 U nRetired,
0693 I myThid )
0694 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_uvel_file',
0695 I UNSET_I, UNSET_I, UNSET_RL, xx_uvel_file, ' ',
0696 I UNSET_RL, UNSET_RL,
0697 U nRetired,
0698 I myThid )
0699 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_vvel_file',
0700 I UNSET_I, UNSET_I, UNSET_RL, xx_vvel_file, ' ',
0701 I UNSET_RL, UNSET_RL,
0702 U nRetired,
0703 I myThid )
0704 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_etan_file',
0705 I UNSET_I, UNSET_I, UNSET_RL, xx_etan_file, ' ',
0706 I UNSET_RL, UNSET_RL,
0707 U nRetired,
0708 I myThid )
0709 CALL CTRL_CHECK_RETIRED_PARMS( 'xx_hfluxm_file',
0710 I UNSET_I, UNSET_I, UNSET_RL, xx_hfluxm_file, ' ',
0711 I UNSET_RL, UNSET_RL,
0712 U nRetired,
0713 I myThid )
0714
0715 IF ( nRetired .GT. 0 ) THEN
0716 WRITE(msgBuf,'(2A)') 'S/R CTRL_READPARMS: ',
0717 & 'Error reading parameter file "data.ctrl"'
0718 CALL PRINT_ERROR( msgBuf, myThid )
0719 WRITE(msgBuf,'(A,I3,A)') 'S/R CTRL_READPARMS: ', nRetired,
0720 & ' out of date parameters were found in namelist CTRL_NML'
0721 CALL PRINT_ERROR( msgBuf, myThid )
0722 CALL ALL_PROC_DIE( 0 )
0723 STOP 'ABNORMAL END: S/R CTRL_READPARMS'
0724 ENDIF
a5904a1bbe Gael*0725
042be14492 Patr*0726 _END_MASTER( myThid )
0727
0728 _BARRIER
0729
cf705a6c8e Mart*0730 RETURN
0731 END
0732
0733
0734
0735
0736
0737 SUBROUTINE CTRL_SET_RETIRED_PARMS(
0738 I xx_startdate1,
0739 I xx_startdate2,
0740 I xx_period,
0741 I xx_file,
0742 I xx_mean_file,
0743 I xx_remo_intercept,
0744 I xx_remo_slope,
0745 I myThid )
0746
0747
0748
0749
0750
0751
0752
0753 IMPLICIT NONE
0754
0755 #include "EEPARAMS.h"
0756
0757
0758 INTEGER xx_startdate1, xx_startdate2
0759 _RL xx_period
0760 CHARACTER*(*) xx_file, xx_mean_file
0761 _RL xx_remo_intercept, xx_remo_slope
0762 INTEGER myThid
0763
0764
0765
0766 xx_startdate1 = UNSET_I
0767 xx_startdate2 = UNSET_I
0768 xx_period = UNSET_RL
0769 xx_remo_intercept = UNSET_RL
0770 xx_remo_slope = UNSET_RL
0771 xx_file = ' '
0772 xx_mean_file = ' '
0773
0774 RETURN
0775 END
0776
0777
0778
0779
0780
0781 SUBROUTINE CTRL_CHECK_RETIRED_PARMS(
0782 I xx_name,
0783 I xx_startdate1,
0784 I xx_startdate2,
0785 I xx_period,
0786 I xx_file,
0787 I xx_mean_file,
0788 I xx_remo_intercept,
0789 I xx_remo_slope,
0790 U nRetired,
0791 I myThid )
0792
0793
0794
0795
0796
0797
0798
0799 IMPLICIT NONE
0800
0801 #include "EEPARAMS.h"
0802
0803
0804 CHARACTER*(*) xx_name
0805 INTEGER xx_startdate1, xx_startdate2
0806 _RL xx_period
0807 CHARACTER*(*) xx_file, xx_mean_file
0808 _RL xx_remo_intercept, xx_remo_slope
0809 INTEGER nRetired
0810 INTEGER myThid
0811
0812
0813 INTEGER ILNBLNK
0814 EXTERNAL ILNBLNK
0815
0816
0817 INTEGER il
0818 CHARACTER*(MAX_LEN_MBUF) msgBuf
0819
0820
0821 IF ( xx_startdate1 .NE. UNSET_I
0822 & .OR. xx_startdate2 .NE. UNSET_I
0823 & .OR. xx_period .NE. UNSET_RL
0824 & .OR. xx_remo_intercept .NE. UNSET_RL
0825 & .OR. xx_remo_slope .NE. UNSET_RL
0826 & .OR. xx_file .NE. ' '
0827 & .OR. xx_mean_file .NE. ' ' ) THEN
0828 il = ILNBLNK(xx_name)
0829 WRITE(msgBuf,'(A,A,A)')
0830 & 'S/R CTRL_READPARMS: ', xx_name(1:il),
0831 & '* is no longer allowed in file "data.ctrl"'
0832 CALL PRINT_ERROR( msgBuf, myThid )
0833 WRITE(msgBuf,'(A)')
0834 & 'S/R CTRL_READPARMS: use generic controls instead'
0835 CALL PRINT_ERROR( msgBuf, myThid )
0836 nRetired = nRetired + 1
0837 ENDIF
0838
0839 RETURN
0840 END