Changeset 13217
- Timestamp:
- 2020-07-02T11:27:33+02:00 (4 years ago)
- Location:
- NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3
- Files:
-
- 24 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/cfgs/AGRIF_DEMO/EXPREF/1_namelist_cfg
r13193 r13217 95 95 ! ! bulk algorithm : 96 96 ln_NCAR = .true. ! "NCAR" algorithm (Large and Yeager 2008) 97 ln_COARE_3p0 = .false. ! "COARE 3.0" algorithm (Fairall et al. 2003)98 ln_COARE_3p6 = .false. ! "COARE 3.6" algorithm (Edson et al. 2013)99 ln_ECMWF = .false. ! "ECMWF" algorithm (IFS cycle 31)100 !101 rn_zqt = 10. ! Air temperature & humidity reference height (m)102 rn_zu = 10. ! Wind vector reference height (m)103 ln_Cd_L12 = .false. ! air-ice drags = F(ice concentration) (Lupkes et al. 2012)104 ln_Cd_L15 = .false. ! air-ice drags = F(ice concentration) (Lupkes et al. 2015)105 rn_pfac = 1. ! multiplicative factor for precipitation (total & snow)106 rn_efac = 1. ! multiplicative factor for evaporation (0. or 1.)107 rn_vfac = 0. ! multiplicative factor for ocean & ice velocity used to108 ! ! calculate the wind stress (0.=absolute or 1.=relative winds)109 ln_skin_cs = .false. ! use the cool-skin parameterization (only available in ECMWF and COARE algorithms) !LB110 ln_skin_wl = .false. ! use the warm-layer " " "111 !112 ln_humi_sph = .true. ! humidity specified below in "sn_humi" is specific humidity [kg/kg] if .true.113 ln_humi_dpt = .false. ! humidity specified below in "sn_humi" is dew-point temperature [K] if .true.114 ln_humi_rlh = .false. ! humidity specified below in "sn_humi" is relative humidity [%] if .true.115 97 ! 116 98 cn_dir = './' ! root directory for the bulk data location -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/cfgs/AGRIF_DEMO/EXPREF/2_namelist_cfg
r13193 r13217 92 92 ! ! bulk algorithm : 93 93 ln_NCAR = .true. ! "NCAR" algorithm (Large and Yeager 2008) 94 ln_COARE_3p0 = .false. ! "COARE 3.0" algorithm (Fairall et al. 2003)95 ln_COARE_3p6 = .false. ! "COARE 3.6" algorithm (Edson et al. 2013)96 ln_ECMWF = .false. ! "ECMWF" algorithm (IFS cycle 31)97 !98 rn_zqt = 10. ! Air temperature & humidity reference height (m)99 rn_zu = 10. ! Wind vector reference height (m)100 ln_Cd_L12 = .false. ! air-ice drags = F(ice concentration) (Lupkes et al. 2012)101 ln_Cd_L15 = .false. ! air-ice drags = F(ice concentration) (Lupkes et al. 2015)102 rn_pfac = 1. ! multiplicative factor for precipitation (total & snow)103 rn_efac = 1. ! multiplicative factor for evaporation (0. or 1.)104 rn_vfac = 0. ! multiplicative factor for ocean & ice velocity used to105 ! ! calculate the wind stress (0.=absolute or 1.=relative winds)106 ln_skin_cs = .false. ! use the cool-skin parameterization (only available in ECMWF and COARE algorithms) !LB107 ln_skin_wl = .false. ! use the warm-layer " " "108 !109 ln_humi_sph = .true. ! humidity specified below in "sn_humi" is specific humidity [kg/kg] if .true.110 ln_humi_dpt = .false. ! humidity specified below in "sn_humi" is dew-point temperature [K] if .true.111 ln_humi_rlh = .false. ! humidity specified below in "sn_humi" is relative humidity [%] if .true.112 94 ! 113 95 cn_dir = './' ! root directory for the bulk data location -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/cfgs/AGRIF_DEMO/EXPREF/namelist_cfg
r13193 r13217 95 95 ! ! bulk algorithm : 96 96 ln_NCAR = .true. ! "NCAR" algorithm (Large and Yeager 2008) 97 ln_COARE_3p0 = .false. ! "COARE 3.0" algorithm (Fairall et al. 2003)98 ln_COARE_3p6 = .false. ! "COARE 3.6" algorithm (Edson et al. 2013)99 ln_ECMWF = .false. ! "ECMWF" algorithm (IFS cycle 31)100 !101 rn_zqt = 10. ! Air temperature & humidity reference height (m)102 rn_zu = 10. ! Wind vector reference height (m)103 ln_Cd_L12 = .false. ! air-ice drags = F(ice concentration) (Lupkes et al. 2012)104 ln_Cd_L15 = .false. ! air-ice drags = F(ice concentration) (Lupkes et al. 2015)105 rn_pfac = 1. ! multiplicative factor for precipitation (total & snow)106 rn_efac = 1. ! multiplicative factor for evaporation (0. or 1.)107 rn_vfac = 0. ! multiplicative factor for ocean & ice velocity used to108 ! ! calculate the wind stress (0.=absolute or 1.=relative winds)109 ln_skin_cs = .false. ! use the cool-skin parameterization (only available in ECMWF and COARE algorithms) !LB110 ln_skin_wl = .false. ! use the warm-layer " " "111 !112 ln_humi_sph = .true. ! humidity specified below in "sn_humi" is specific humidity [kg/kg] if .true.113 ln_humi_dpt = .false. ! humidity specified below in "sn_humi" is dew-point temperature [K] if .true.114 ln_humi_rlh = .false. ! humidity specified below in "sn_humi" is relative humidity [%] if .true.115 97 ! 116 98 cn_dir = './' ! root directory for the bulk data location -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/cfgs/ORCA2_ICE_ABL/EXPREF/file_def_nemo-oce.xml
r12063 r13217 56 56 <field field_ref="t_abl" /> 57 57 <field field_ref="q_abl" /> 58 <field field_ref="uvz1_abl" /> 59 <field field_ref="tz1_abl" /> 60 <field field_ref="qz1_abl" /> 61 <field field_ref="uvz1_dta" /> 62 <field field_ref="tz1_dta" /> 63 <field field_ref="qz1_dta" /> 58 64 <field field_ref="pblh" /> 59 65 </file> -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/cfgs/ORCA2_ICE_ABL/EXPREF/namelist_cfg
r13193 r13217 110 110 ! ! bulk algorithm : 111 111 ln_NCAR = .true. ! "NCAR" algorithm (Large and Yeager 2008) 112 ln_COARE_3p0 = .false. ! "COARE 3.0" algorithm (Fairall et al. 2003)113 ln_COARE_3p6 = .false. ! "COARE 3.6" algorithm (Edson et al. 2013)114 ln_ECMWF = .false. ! "ECMWF" algorithm (IFS cycle 31)115 rn_zqt = 10. ! Air temperature & humidity reference height (m)116 rn_zu = 10. ! Wind vector reference height (m)117 !118 ! Skin is ONLY available in ECMWF and COARE algorithms:119 ln_skin_cs = .false. ! use the cool-skin parameterization => set nn_fsbc=1 and ln_dm2dc=.true.!120 ln_skin_wl = .false. ! use the warm-layer " => set nn_fsbc=1 and ln_dm2dc=.true.!121 !122 ln_humi_sph = .true. ! humidity specified below in "sn_humi" is specific humidity [kg/kg] if .true.123 ln_humi_dpt = .false. ! humidity specified below in "sn_humi" is dew-point temperature [K] if .true.124 ln_humi_rlh = .false. ! humidity specified below in "sn_humi" is relative humidity [%] if .true.125 112 ! 126 113 cn_dir = './' ! root directory for the bulk data location … … 132 119 sn_tair = 'tair_drwnlnd_ERAI_L25Z10_GLOBAL_F128R_ana1d', 24., 'tair' , .false. , .false. , 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bilinear' , '' , '' 133 120 sn_humi = 'humi_drwnlnd_ERAI_L25Z10_GLOBAL_F128R_ana1d', 24., 'humi' , .false. , .false. , 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bilinear' , '' , '' 134 sn_hpgi = 'uhpg_drwnlnd_ERAI_L25Z10_GLOBAL_F128R_ana1d', 24., 'uhpg' , .false. , .false. , 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic' , 'UG' , ''135 sn_hpgj = 'vhpg_drwnlnd_ERAI_L25Z10_GLOBAL_F128R_ana1d', 24., 'vhpg' , .false. , .false. , 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic' , 'VG' , ''136 137 121 sn_qsr = 'ncar_rad.15JUNE2009_fill' , 24., 'SWDN_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , '' 138 122 sn_qlw = 'ncar_rad.15JUNE2009_fill' , 24., 'LWDN_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , '' … … 140 124 sn_snow = 'ncar_precip.15JUNE2009_fill' , -1., 'SNOW' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , '' 141 125 sn_slp = 'slp.15JUNE2009_fill' , 6., 'SLP' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , '' 126 sn_hpgi = 'uhpg_drwnlnd_ERAI_L25Z10_GLOBAL_F128R_ana1d', 24., 'uhpg' , .false. , .false. , 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic' , 'UG' , '' 127 sn_hpgj = 'vhpg_drwnlnd_ERAI_L25Z10_GLOBAL_F128R_ana1d', 24., 'vhpg' , .false. , .false. , 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic' , 'VG' , '' 142 128 / 143 129 -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/cfgs/ORCA2_ICE_PISCES/EXPREF/namelist_cfg
r13193 r13217 121 121 / 122 122 !----------------------------------------------------------------------- 123 &namsbc_abl ! Atmospheric Boundary Layer formulation (ln_abl = T) 124 !----------------------------------------------------------------------- 125 / 126 !----------------------------------------------------------------------- 123 127 &namtra_qsr ! penetrative solar radiation (ln_traqsr =T) 124 128 !----------------------------------------------------------------------- -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/cfgs/ORCA2_SAS_ICE/EXPREF/namelist_cfg
r13193 r13217 68 68 ! ! bulk algorithm : 69 69 ln_NCAR = .true. ! "NCAR" algorithm (Large and Yeager 2008) 70 ln_COARE_3p0 = .false. ! "COARE 3.0" algorithm (Fairall et al. 2003)71 ln_COARE_3p6 = .false. ! "COARE 3.6" algorithm (Edson et al. 2013)72 ln_ECMWF = .false. ! "ECMWF" algorithm (IFS cycle 31)73 !74 rn_zqt = 10. ! Air temperature & humidity reference height (m)75 rn_zu = 10. ! Wind vector reference height (m)76 ln_Cd_L12 = .false. ! air-ice drags = F(ice concentration) (Lupkes et al. 2012)77 ln_Cd_L15 = .false. ! air-ice drags = F(ice concentration) (Lupkes et al. 2015)78 rn_pfac = 1. ! multiplicative factor for precipitation (total & snow)79 rn_efac = 1. ! multiplicative factor for evaporation (0. or 1.)80 rn_vfac = 0. ! multiplicative factor for ocean & ice velocity used to81 ! ! calculate the wind stress (0.=absolute or 1.=relative winds)82 ln_skin_cs = .false. ! use the cool-skin parameterization (only available in ECMWF and COARE algorithms) !LB83 ln_skin_wl = .false. ! use the warm-layer " " "84 !85 ln_humi_sph = .true. ! humidity specified below in "sn_humi" is specific humidity [kg/kg] if .true.86 ln_humi_dpt = .false. ! humidity specified below in "sn_humi" is dew-point temperature [K] if .true.87 ln_humi_rlh = .false. ! humidity specified below in "sn_humi" is relative humidity [%] if .true.88 70 ! 89 71 cn_dir = './' ! root directory for the bulk data location -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/cfgs/SHARED/field_def_nemo-oce.xml
r13193 r13217 455 455 <field id="t_dta" long_name="DTA potential temperature" standard_name="dta_theta" unit="K" /> 456 456 <field id="q_dta" long_name="DTA specific humidity" standard_name="dta_qspe" unit="kg/kg" /> 457 <field id="coeft" long_name="ABL nudging coefficient" standard_name="coeft" unit="" /> 457 <field id="u_geo" long_name="GEO i-horizontal velocity" standard_name="geo_x_velocity" unit="m/s" /> 458 <field id="v_geo" long_name="GEO j-horizontal velocity" standard_name="geo_y_velocity" unit="m/s" /> 458 459 <field id="tke_abl" long_name="ABL turbulent kinetic energy" standard_name="abl_tke" unit="m2/s2" /> 459 460 <field id="avm_abl" long_name="ABL turbulent viscosity" standard_name="abl_avm" unit="m2/s" /> 460 461 <field id="avt_abl" long_name="ABL turbulent diffusivity" standard_name="abl_avt" unit="m2/s" /> 461 <field id="mxl_abl" long_name="ABL mixing length" standard_name="abl_mxl" unit="m" /> 462 <field id="mxlm_abl" long_name="ABL master mixing length" standard_name="abl_mxlm" unit="m" /> 463 <field id="mxld_abl" long_name="ABL dissipative mixing length" standard_name="abl_mxld" unit="m" /> 462 464 </field_group> 463 465 -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/cfgs/SHARED/namelist_ref
r13193 r13217 268 268 ln_Cd_L12 = .false. ! air-ice drags = F(ice conc.) (Lupkes et al. 2012) 269 269 ln_Cd_L15 = .false. ! air-ice drags = F(ice conc.) (Lupkes et al. 2015) 270 ! ! - module of the mean stress" data 270 ln_crt_fbk = .false. ! Add surface current feedback to the wind stress (Renault et al. 2020, doi: 10.1029/2019MS001715) 271 rn_stau_a = -2.9e-3 ! Alpha from eq. 10: Stau = Alpha * Wnd + Beta 272 rn_stau_b = 8.0e-3 ! Beta 271 273 rn_pfac = 1. ! multipl. factor for precipitation (total & snow) 272 274 rn_efac = 1. ! multipl. factor for evaporation (0. or 1.) 273 rn_vfac = 0. ! multipl. factor for ocean & ice velocity274 ! ! used to calculate the wind stress275 ! ! (0. => absolute or 1. => relative winds)276 275 ln_skin_cs = .false. ! use the cool-skin parameterization 277 276 ln_skin_wl = .false. ! use the warm-layer parameterization … … 280 279 ln_humi_dpt = .false. ! humidity "sn_humi" is dew-point temperature [K] 281 280 ln_humi_rlh = .false. ! humidity "sn_humi" is relative humidity [%] 281 ln_tpot = .true. !!GS: compute potential temperature or not 282 282 ! 283 283 cn_dir = './' ! root directory for the bulk data location … … 291 291 sn_tair = 't_10.15JUNE2009_fill' , 6. , 'T_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , '' 292 292 sn_humi = 'q_10.15JUNE2009_fill' , 6. , 'Q_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , '' 293 sn_hpgi = 'NOT USED' , 24. , 'uhpg' , .false. , .false., 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic', 'UG' , ''294 sn_hpgj = 'NOT USED' , 24. , 'vhpg' , .false. , .false., 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic', 'VG' , ''295 293 sn_prec = 'ncar_precip.15JUNE2009_fill', -1. , 'PRC_MOD1', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , '' 296 294 sn_snow = 'ncar_precip.15JUNE2009_fill', -1. , 'SNOW' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , '' 297 295 sn_slp = 'slp.15JUNE2009_fill' , 6. , 'SLP' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , '' 296 sn_uoatm = 'NOT USED' , 6. , 'UOATM' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , 'Uoceatm', '' 297 sn_voatm = 'NOT USED' , 6. , 'VOATM' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , 'Voceatm', '' 298 sn_hpgi = 'NOT USED' , 24. , 'uhpg' , .false. , .false., 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic', 'UG' , '' 299 sn_hpgj = 'NOT USED' , 24. , 'vhpg' , .false. , .false., 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic', 'VG' , '' 298 300 / 299 301 !----------------------------------------------------------------------- … … 308 310 cn_ablrst_outdir = "." ! directory to write output abl restarts 309 311 312 ln_rstart_abl = .false. 310 313 ln_hpgls_frc = .false. 311 314 ln_geos_winds = .false. 312 nn_dyn_restore = 2 ! restoring option for dynamical ABL variables: = 0 no restoring 315 ln_smth_pblh = .false. 316 nn_dyn_restore = 0 ! restoring option for dynamical ABL variables: = 0 no restoring 313 317 ! = 1 equatorial restoring 314 318 ! = 2 global restoring 315 rn_ldyn_min = 4.5 ! magnitude of the nudging on ABL dynamics at the bottom of the ABL [hour]316 rn_ldyn_max = 1.5 ! magnitude of the nudging on ABL dynamics at the top of the ABL [hour]317 rn_ltra_min = 4.5 ! magnitude of the nudging on ABL tracers at the bottom of the ABL [hour]318 rn_ltra_max = 1.5 ! magnitude of the nudging on ABL tracers at the top of the ABL [hour]319 rn_ldyn_min = 4.5 ! dynamics nudging magnitude inside the ABL [hour] (~3 rn_Dt) 320 rn_ldyn_max = 1.5 ! dynamics nudging magnitude above the ABL [hour] (~1 rn_Dt) 321 rn_ltra_min = 4.5 ! tracers nudging magnitude inside the ABL [hour] (~3 rn_Dt) 322 rn_ltra_max = 1.5 ! tracers nudging magnitude above the ABL [hour] (~1 rn_Dt) 319 323 nn_amxl = 0 ! mixing length: = 0 Deardorff 80 length-scale 320 324 ! = 1 length-scale based on the distance to the PBL height 321 325 ! = 2 Bougeault & Lacarrere 89 length-scale 322 rn_Cm = 0.0667 ! 0.126 in MesoNH 323 rn_Ct = 0.1667 ! 0.143 in MesoNH 324 rn_Ce = 0.4 ! 0.4 in MesoNH 325 rn_Ceps = 0.7 ! 0.85 in MesoNH 326 rn_Rod = 0.15 ! c0 in RMCA17 mixing length formulation (not yet implemented) 327 rn_Ric = 0.139 ! Critical Richardson number (to compute PBL height and diffusivities) 326 ! CBR00 ! CCH02 ! MesoNH ! 327 rn_Cm = 0.0667 ! 0.0667 ! 0.1260 ! 0.1260 ! 328 rn_Ct = 0.1667 ! 0.1667 ! 0.1430 ! 0.1430 ! 329 rn_Ce = 0.40 ! 0.40 ! 0.34 ! 0.40 ! 330 rn_Ceps = 0.700 ! 0.700 ! 0.845 ! 0.850 ! 331 rn_Ric = 0.139 ! 0.139 ! 0.143 ! ? ! Critical Richardson number (to compute PBL height and diffusivities) 332 rn_Rod = 0.15 ! c0 in RMCA17 mixing length formulation (not yet implemented) 328 333 / 329 334 !----------------------------------------------------------------------- -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/cfgs/WED025/EXPREF/namelist_cfg
r13193 r13217 138 138 !----------------------------------------------------------------------- 139 139 ! ! bulk algorithm : 140 ln_NCAR = .true. ! "NCAR" algorithm (Large and Yeager 2008)140 ln_NCAR = .true. ! "NCAR" algorithm (Large and Yeager 2008) 141 141 ln_COARE_3p0 = .false. ! "COARE 3.0" algorithm (Fairall et al. 2003) 142 142 ln_COARE_3p6 = .false. ! "COARE 3.6" algorithm (Edson et al. 2013) 143 143 ln_ECMWF = .false. ! "ECMWF" algorithm (IFS cycle 45r1) 144 144 ! 145 145 cn_dir = './' ! root directory for the bulk data location 146 146 !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________! -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/doc/latex/NEMO/subfiles/chap_SBC.tex
r12377 r13217 832 832 Solid precipitation & snow & $Kg.m^{-2}.s^{-1}$ & T \\ 833 833 \hline 834 Mean sea-level pressure & slp & $ hPa$ & T \\834 Mean sea-level pressure & slp & $Pa$ & T \\ 835 835 \hline 836 836 \end{tabular} -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/ABL/abl.F90
r12724 r13217 29 29 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: avm_abl !: turbulent viscosity [m2/s] 30 30 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: avt_abl !: turbulent diffusivity [m2/s] 31 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: mxl_abl !: mixing length [m] 31 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: mxld_abl !: dissipative mixing length [m] 32 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) :: mxlm_abl !: master mixing length [m] 32 33 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:,:) :: tke_abl !: turbulent kinetic energy [m2/s2] 33 34 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: fft_abl !: Coriolis parameter [1/s] … … 55 56 !!---------------------------------------------------------------------- 56 57 ! 57 ALLOCATE( u_abl (1:jpi,1:jpj,1:jpka,jptime), & 58 & v_abl (1:jpi,1:jpj,1:jpka,jptime), & 59 & tq_abl (1:jpi,1:jpj,1:jpka,jptime,jptq), & 60 & avm_abl(1:jpi,1:jpj,1:jpka), & 61 & avt_abl(1:jpi,1:jpj,1:jpka), & 62 & mxl_abl(1:jpi,1:jpj,1:jpka), & 63 & tke_abl(1:jpi,1:jpj,1:jpka,jptime), & 64 & fft_abl(1:jpi,1:jpj), & 65 & pblh (1:jpi,1:jpj), & 66 & msk_abl(1:jpi,1:jpj), & 67 & rest_eq(1:jpi,1:jpj), & 68 & e3t_abl(1:jpka), e3w_abl(1:jpka), ght_abl(1:jpka), ghw_abl(1:jpka), STAT=ierr ) 58 ALLOCATE( u_abl (1:jpi,1:jpj,1:jpka,jptime ), & 59 & v_abl (1:jpi,1:jpj,1:jpka,jptime ), & 60 & tq_abl (1:jpi,1:jpj,1:jpka,jptime,jptq), & 61 & tke_abl (1:jpi,1:jpj,1:jpka,jptime ), & 62 & avm_abl (1:jpi,1:jpj,1:jpka ), & 63 & avt_abl (1:jpi,1:jpj,1:jpka ), & 64 & mxld_abl(1:jpi,1:jpj,1:jpka ), & 65 & mxlm_abl(1:jpi,1:jpj,1:jpka ), & 66 & fft_abl (1:jpi,1:jpj ), & 67 & pblh (1:jpi,1:jpj ), & 68 & msk_abl (1:jpi,1:jpj ), & 69 & rest_eq (1:jpi,1:jpj ), & 70 & e3t_abl (1:jpka), e3w_abl(1:jpka) , & 71 & ght_abl (1:jpka), ghw_abl(1:jpka) , STAT=ierr ) 69 72 ! 70 73 abl_alloc = ierr -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/ABL/ablmod.F90
r13193 r13217 2 2 !!====================================================================== 3 3 !! *** MODULE ablmod *** 4 !! Surface module : ABL computation to provide atmospheric data 4 !! Surface module : ABL computation to provide atmospheric data 5 5 !! for surface fluxes computation 6 6 !!====================================================================== 7 7 !! History : 3.6 ! 2019-03 (F. Lemarié & G. Samson) Original code 8 8 !!---------------------------------------------------------------------- 9 9 10 10 !!---------------------------------------------------------------------- 11 11 !! abl_stp : ABL single column model … … 16 16 17 17 USE phycst ! physical constants 18 USE dom_oce, ONLY : tmask 18 USE dom_oce, ONLY : tmask 19 19 USE sbc_oce, ONLY : ght_abl, ghw_abl, e3t_abl, e3w_abl, jpka, jpkam1, rhoa 20 USE sbcblk ! use rn_ ?fac20 USE sbcblk ! use rn_efac, cdn_oce 21 21 USE sbcblk_phy ! use some physical constants for flux computation 22 22 ! … … 30 30 31 31 PUBLIC abl_stp ! called by sbcabl.F90 32 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: ustar2 32 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: ustar2, zrough 33 33 !! * Substitutions 34 34 # include "do_loop_substitute.h90" … … 38 38 39 39 !=================================================================================================== 40 SUBROUTINE abl_stp( kt, psst, pssu, pssv, pssq, &! in41 & pu_dta, pv_dta, pt_dta, pq_dta, & 40 SUBROUTINE abl_stp( kt, psst, pssu, pssv, pssq, & ! in 41 & pu_dta, pv_dta, pt_dta, pq_dta, & 42 42 & pslp_dta, pgu_dta, pgv_dta, & 43 & pcd_du, psen, pevp, & ! in/out 44 & pwndm, ptaui, ptauj, ptaum & 45 #if defined key_si3 46 & , ptm_su,pssu_ice,pssv_ice,pssq_ice,pcd_du_ice & 47 & , psen_ice, pevp_ice, pwndm_ice, pfrac_oce & 48 & , ptaui_ice, ptauj_ice & 49 #endif 50 & ) 43 & pcd_du, psen, pevp, & ! in/out 44 & pwndm, ptaui, ptauj, ptaum & 45 #if defined key_si3 46 & , ptm_su, pssu_ice, pssv_ice & 47 & , pssq_ice, pcd_du_ice, psen_ice & 48 & , pevp_ice, pwndm_ice, pfrac_oce & 49 & , ptaui_ice, ptauj_ice & 50 #endif 51 & ) 51 52 !--------------------------------------------------------------------------------------------------- 52 53 … … 54 55 !! *** ROUTINE abl_stp *** 55 56 !! 56 !! ** Purpose : Time-integration of the ABL model 57 !! ** Purpose : Time-integration of the ABL model 57 58 !! 58 !! ** Method : Compute atmospheric variables : vertical turbulence 59 !! ** Method : Compute atmospheric variables : vertical turbulence 59 60 !! + Coriolis term + newtonian relaxation 60 !! 61 !! 61 62 !! ** Action : - Advance TKE to time n+1 and compute Avm_abl, Avt_abl, PBLh 62 63 !! - Advance tracers to time n+1 (Euler backward scheme) … … 70 71 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: psst ! sea-surface temperature [Celsius] 71 72 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pssu ! sea-surface u (U-point) 72 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pssv ! sea-surface v (V-point) 73 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pssv ! sea-surface v (V-point) 73 74 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pssq ! sea-surface humidity 74 75 REAL(wp) , INTENT(in ), DIMENSION(:,:,:) :: pu_dta ! large-scale windi … … 82 83 REAL(wp) , INTENT(inout), DIMENSION(:,: ) :: psen ! Ch x Du 83 84 REAL(wp) , INTENT(inout), DIMENSION(:,: ) :: pevp ! Ce x Du 84 REAL(wp) , INTENT(inout), DIMENSION(:,: ) :: pwndm ! ||uwnd|| 85 REAL(wp) , INTENT(inout), DIMENSION(:,: ) :: pwndm ! ||uwnd|| 85 86 REAL(wp) , INTENT( out), DIMENSION(:,: ) :: ptaui ! taux 86 87 REAL(wp) , INTENT( out), DIMENSION(:,: ) :: ptauj ! tauy 87 REAL(wp) , INTENT( out), DIMENSION(:,: ) :: ptaum ! ||tau|| 88 ! 89 #if defined key_si3 88 REAL(wp) , INTENT( out), DIMENSION(:,: ) :: ptaum ! ||tau|| 89 ! 90 #if defined key_si3 90 91 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: ptm_su ! ice-surface temperature [K] 91 92 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pssu_ice ! ice-surface u (U-point) 92 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pssv_ice ! ice-surface v (V-point) 93 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pssq_ice ! ice-surface humidity 93 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pssv_ice ! ice-surface v (V-point) 94 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pssq_ice ! ice-surface humidity 94 95 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pcd_du_ice ! Cd x Du over ice (T-point) 95 96 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: psen_ice ! Ch x Du over ice (T-point) 96 97 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pevp_ice ! Ce x Du over ice (T-point) 97 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pwndm_ice ! ||uwnd - uice|| 98 !REAL(wp) , INTENT(inout), DIMENSION(:,: ) :: pfrac_oce !!GS: out useless ? 99 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pfrac_oce ! 98 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pwndm_ice ! ||uwnd - uice|| 99 REAL(wp) , INTENT(in ), DIMENSION(:,: ) :: pfrac_oce ! ocean fraction 100 100 REAL(wp) , INTENT( out), DIMENSION(:,: ) :: ptaui_ice ! ice-surface taux stress (U-point) 101 REAL(wp) , INTENT( out), DIMENSION(:,: ) :: ptauj_ice ! ice-surface tauy stress (V-point) 102 #endif 103 ! 104 REAL(wp), DIMENSION(1:jpi,1:jpj ) :: zwnd_i, zwnd_j 105 REAL(wp), DIMENSION(1:jpi,2:jpka ) :: zCF 106 REAL(wp), DIMENSION(1:jpi,1:jpj,1:jpka) :: z_cft !--FL--to be removed after the test phase 107 ! 108 REAL(wp), DIMENSION(1:jpi,1:jpka ) :: z_elem_a 109 REAL(wp), DIMENSION(1:jpi,1:jpka ) :: z_elem_b 110 REAL(wp), DIMENSION(1:jpi,1:jpka ) :: z_elem_c 101 REAL(wp) , INTENT( out), DIMENSION(:,: ) :: ptauj_ice ! ice-surface tauy stress (V-point) 102 #endif 103 ! 104 REAL(wp), DIMENSION(1:jpi,1:jpj ) :: zwnd_i, zwnd_j 105 REAL(wp), DIMENSION(1:jpi ,2:jpka) :: zCF 106 ! 107 REAL(wp), DIMENSION(1:jpi ,1:jpka) :: z_elem_a 108 REAL(wp), DIMENSION(1:jpi ,1:jpka) :: z_elem_b 109 REAL(wp), DIMENSION(1:jpi ,1:jpka) :: z_elem_c 111 110 ! 112 111 INTEGER :: ji, jj, jk, jtra, jbak ! dummy loop indices 113 112 REAL(wp) :: zztmp, zcff, ztemp, zhumi, zcff1, zztmp1, zztmp2 114 113 REAL(wp) :: zcff2, zfcor, zmsk, zsig, zcffu, zcffv, zzice,zzoce 115 ! 116 !!--------------------------------------------------------------------- 114 LOGICAL :: SemiImp_Cor = .TRUE. 115 ! 116 !!--------------------------------------------------------------------- 117 117 ! 118 118 IF(lwp .AND. kt == nit000) THEN ! control print … … 120 120 WRITE(numout,*) 'abl_stp : ABL time stepping' 121 121 WRITE(numout,*) '~~~~~~' 122 ENDIF 122 ENDIF 123 123 ! 124 124 IF( kt == nit000 ) ALLOCATE ( ustar2( 1:jpi, 1:jpj ) ) 125 !! Compute ustar squared as Cd || Uatm-Uoce ||^2 126 !! needed for surface boundary condition of TKE 125 IF( kt == nit000 ) ALLOCATE ( zrough( 1:jpi, 1:jpj ) ) 126 !! Compute ustar squared as Cd || Uatm-Uoce ||^2 127 !! needed for surface boundary condition of TKE 127 128 !! pwndm contains | U10m - U_oce | (see blk_oce_1 in sbcblk) 128 129 DO_2D_11_11 129 130 zzoce = pCd_du (ji,jj) * pwndm (ji,jj) 130 131 #if defined key_si3 131 zzice = pCd_du_ice(ji,jj) * pwndm_ice(ji,jj) 132 ustar2(ji,jj) = zzoce * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * zzice 132 zzice = pCd_du_ice(ji,jj) * pwndm_ice(ji,jj) 133 ustar2(ji,jj) = zzoce * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * zzice 133 134 #else 134 ustar2(ji,jj) = zzoce 135 ustar2(ji,jj) = zzoce 135 136 #endif 137 zrough(ji,jj) = ght_abl(2) * EXP( - vkarmn / SQRT( MAX( Cdn_oce(ji,jj), 1.e-4 ) ) ) !<-- recover the value of z0 from Cdn_oce 136 138 END_2D 137 139 ! … … 140 142 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 141 143 142 CALL abl_zdf_tke( ) !--> Avm_abl, Avt_abl, pblh defined on (1,jpi) x (1,jpj) 143 144 CALL abl_zdf_tke( ) !--> Avm_abl, Avt_abl, pblh defined on (1,jpi) x (1,jpj) 145 144 146 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 145 147 ! ! 2 *** Advance tracers to time n+1 146 148 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 147 149 148 150 !------------- 149 151 DO jj = 1, jpj ! outer loop !--> tq_abl computed on (1:jpi) x (1:jpj) 150 !------------- 151 ! Compute matrix elements for interior points 152 !------------- 153 ! Compute matrix elements for interior points 152 154 DO jk = 3, jpkam1 153 155 DO ji = 1, jpi ! vector opt. 154 z_elem_a( ji, jk) = - rDt_abl * Avt_abl( ji, jj, jk-1 ) / e3w_abl( jk-1 ) ! lower-diagonal155 z_elem_c( ji, jk ) = - rDt_abl * Avt_abl( ji, jj, jk ) / e3w_abl( jk ) ! upper-diagonal156 z_elem_b( ji, jk ) = e3t_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk ) ! diagonal157 END DO 158 END DO 159 ! Boundary conditions 160 DO ji = 1, jpi ! vector opt. 161 ! Neumann at the bottom 162 z_elem_a( ji, 2) = 0._wp163 z_elem_c( ji, 2 ) = - rDt_abl * Avt_abl( ji, jj, 2 ) / e3w_abl( 2 )156 z_elem_a( ji, jk ) = - rDt_abl * Avt_abl( ji, jj, jk-1 ) / e3w_abl( jk-1 ) ! lower-diagonal 157 z_elem_c( ji, jk ) = - rDt_abl * Avt_abl( ji, jj, jk ) / e3w_abl( jk ) ! upper-diagonal 158 z_elem_b( ji, jk ) = e3t_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk ) ! diagonal 159 END DO 160 END DO 161 ! Boundary conditions 162 DO ji = 1, jpi ! vector opt. 163 ! Neumann at the bottom 164 z_elem_a( ji, 2 ) = 0._wp 165 z_elem_c( ji, 2 ) = - rDt_abl * Avt_abl( ji, jj, 2 ) / e3w_abl( 2 ) 164 166 ! Homogeneous Neumann at the top 165 z_elem_a( ji, jpka ) = - rDt_abl * Avt_abl( ji, jj, jpka ) / e3w_abl( jpka )166 z_elem_c( ji, jpka) = 0._wp167 z_elem_b( ji, jpka ) = e3t_abl( jpka ) - z_elem_a( ji,jpka )168 END DO 167 z_elem_a( ji, jpka ) = - rDt_abl * Avt_abl( ji, jj, jpka ) / e3w_abl( jpka ) 168 z_elem_c( ji, jpka ) = 0._wp 169 z_elem_b( ji, jpka ) = e3t_abl( jpka ) - z_elem_a( ji, jpka ) 170 END DO 169 171 170 172 DO jtra = 1,jptq ! loop on active tracers 171 173 172 174 DO jk = 3, jpkam1 173 DO ji = 1,jpi 174 tq_abl ( ji, jj, jk, nt_a, jtra ) = e3t_abl(jk) * tq_abl ( ji, jj, jk, nt_n, jtra ) ! initialize right-hand-side 175 !DO ji = 2, jpim1 176 DO ji = 1,jpi !!GS: to be checked if needed 177 tq_abl( ji, jj, jk, nt_a, jtra ) = e3t_abl(jk) * tq_abl( ji, jj, jk, nt_n, jtra ) ! initialize right-hand-side 175 178 END DO 176 179 END DO 177 180 178 181 IF(jtra == jp_ta) THEN 179 DO ji = 1,jpi ! boundary conditions for temperature180 zztmp1 = psen(ji, jj) 181 zztmp2 = psen(ji, jj) * ( psst(ji, jj) + rt0 ) 182 #if defined key_si3 183 zztmp1 = zztmp1 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * psen_ice(ji,jj) 182 DO ji = 1,jpi ! surface boundary condition for temperature 183 zztmp1 = psen(ji, jj) 184 zztmp2 = psen(ji, jj) * ( psst(ji, jj) + rt0 ) 185 #if defined key_si3 186 zztmp1 = zztmp1 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * psen_ice(ji,jj) 184 187 zztmp2 = zztmp2 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * psen_ice(ji,jj) * ptm_su(ji,jj) 185 #endif 186 z_elem_b( ji, 2 ) = e3t_abl( 2 ) - z_elem_c( ji, 2 ) + rDt_abl * zztmp1187 tq_abl ( ji, jj, 2 , nt_a, jtra ) = e3t_abl( 2 ) * tq_abl ( ji, jj, 2 , nt_n, jtra ) + rDt_abl * zztmp2188 #endif 189 z_elem_b( ji, 2 ) = e3t_abl( 2 ) - z_elem_c( ji, 2 ) + rDt_abl * zztmp1 190 tq_abl ( ji, jj, 2, nt_a, jtra ) = e3t_abl( 2 ) * tq_abl ( ji, jj, 2, nt_n, jtra ) + rDt_abl * zztmp2 188 191 tq_abl ( ji, jj, jpka, nt_a, jtra ) = e3t_abl( jpka ) * tq_abl ( ji, jj, jpka, nt_n, jtra ) 189 END DO 190 ELSE 191 DO ji = 1,jpi ! boundary conditions for humidity192 zztmp1 = pevp(ji, jj) 193 zztmp2 = pevp(ji, jj) * pssq(ji, jj) 194 #if defined key_si3 195 zztmp1 = zztmp1 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * pevp_ice(ji,jj) 196 zztmp2 = zztmp2 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * pevp_ice(ji, jj) * pssq_ice(ji, jj) 197 #endif 198 z_elem_b( ji, 2 ) = e3t_abl( 2 ) - z_elem_c( ji, 2) + rDt_abl * zztmp1199 tq_abl ( ji, jj, 2 , nt_a, jtra ) = e3t_abl( 2 ) * tq_abl ( ji, jj, 2 , nt_n, jtra ) + rDt_abl * zztmp2192 END DO 193 ELSE ! jp_qa 194 DO ji = 1,jpi ! surface boundary condition for humidity 195 zztmp1 = pevp(ji, jj) 196 zztmp2 = pevp(ji, jj) * pssq(ji, jj) 197 #if defined key_si3 198 zztmp1 = zztmp1 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * pevp_ice(ji,jj) 199 zztmp2 = zztmp2 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * pevp_ice(ji, jj) * pssq_ice(ji, jj) 200 #endif 201 z_elem_b( ji, 2 ) = e3t_abl( 2 ) - z_elem_c( ji, 2 ) + rDt_abl * zztmp1 202 tq_abl ( ji, jj, 2 , nt_a, jtra ) = e3t_abl( 2 ) * tq_abl ( ji, jj, 2, nt_n, jtra ) + rDt_abl * zztmp2 200 203 tq_abl ( ji, jj, jpka, nt_a, jtra ) = e3t_abl( jpka ) * tq_abl ( ji, jj, jpka, nt_n, jtra ) 201 END DO 204 END DO 202 205 END IF 203 206 !! 204 207 !! Matrix inversion 205 208 !! ---------------------------------------------------------- 206 DO ji = 1,jpi 207 zcff = 1._wp / z_elem_b( ji, 2 )208 zCF ( ji, 2) = - zcff * z_elem_c( ji, 2 )209 tq_abl( ji,jj,2,nt_a,jtra) = zcff * tq_abl(ji,jj,2,nt_a,jtra)210 END DO 211 212 DO jk = 3, jpka 213 DO ji = 1,jpi 214 zcff = 1._wp / ( z_elem_b( ji, jk ) + z_elem_a( ji, jk ) * zCF (ji, jk-1 ) )209 DO ji = 1,jpi 210 zcff = 1._wp / z_elem_b( ji, 2 ) 211 zCF ( ji, 2 ) = - zcff * z_elem_c( ji, 2 ) 212 tq_abl( ji, jj, 2, nt_a, jtra ) = zcff * tq_abl( ji, jj, 2, nt_a, jtra ) 213 END DO 214 215 DO jk = 3, jpka 216 DO ji = 1,jpi 217 zcff = 1._wp / ( z_elem_b( ji, jk ) + z_elem_a( ji, jk ) * zCF( ji, jk-1 ) ) 215 218 zCF(ji,jk) = - zcff * z_elem_c( ji, jk ) 216 219 tq_abl(ji,jj,jk,nt_a,jtra) = zcff * ( tq_abl(ji,jj,jk ,nt_a,jtra) & 217 & - z_elem_a(ji, jk) *tq_abl(ji,jj,jk-1,nt_a,jtra) )218 END DO 219 END DO 220 !!FL at this point we could check positivity of tq_abl(:,:,:,nt_a,jp_qa) ... test to do ... 221 DO jk = jpkam1,2,-1 222 DO ji = 1,jpi 220 & - z_elem_a(ji, jk) * tq_abl(ji,jj,jk-1,nt_a,jtra) ) 221 END DO 222 END DO 223 !!FL at this point we could check positivity of tq_abl(:,:,:,nt_a,jp_qa) ... test to do ... 224 DO jk = jpkam1,2,-1 225 DO ji = 1,jpi 223 226 tq_abl(ji,jj,jk,nt_a,jtra) = tq_abl(ji,jj,jk,nt_a,jtra) + & 224 227 & zCF(ji,jk) * tq_abl(ji,jj,jk+1,nt_a,jtra) 225 228 END DO 226 229 END DO 227 228 END DO !<-- loop on tracers 229 !! 230 !------------- 231 END DO ! end outer loop 232 !------------- 233 234 230 231 END DO !<-- loop on tracers 232 !! 233 !------------- 234 END DO ! end outer loop 235 !------------- 236 235 237 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 236 238 ! ! 3 *** Compute Coriolis term with geostrophic guide 237 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 238 !------------- 239 DO jk = 2, jpka ! outer loop 240 !------------- 241 ! 242 ! Advance u_abl & v_abl to time n+1 243 DO_2D_11_11 244 zcff = ( fft_abl(ji,jj) * rDt_abl )*( fft_abl(ji,jj) * rDt_abl ) ! (f dt)**2 239 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 240 IF( SemiImp_Cor ) THEN 241 242 !------------- 243 DO jk = 2, jpka ! outer loop 244 !------------- 245 ! 246 ! Advance u_abl & v_abl to time n+1 247 DO_2D_11_11 248 zcff = ( fft_abl(ji,jj) * rDt_abl )*( fft_abl(ji,jj) * rDt_abl ) ! (f dt)**2 249 250 u_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *( & 251 & (1._wp-gamma_Cor*(1._wp-gamma_Cor)*zcff) * u_abl( ji, jj, jk, nt_n ) & 252 & + rDt_abl * fft_abl(ji, jj) * v_abl( ji, jj, jk, nt_n ) ) & 253 & / (1._wp + gamma_Cor*gamma_Cor*zcff) 245 254 246 u_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *( & 247 & (1._wp-gamma_Cor*(1._wp-gamma_Cor)*zcff)*u_abl( ji, jj, jk, nt_n ) & 248 & + rDt_abl * fft_abl(ji, jj) * v_abl ( ji , jj , jk, nt_n ) ) & 249 & / (1._wp + gamma_Cor*gamma_Cor*zcff) 250 251 v_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *( & 252 & (1._wp-gamma_Cor*(1._wp-gamma_Cor)*zcff)*v_abl( ji, jj, jk, nt_n ) & 253 & - rDt_abl * fft_abl(ji, jj) * u_abl ( ji , jj, jk, nt_n ) ) & 254 & / (1._wp + gamma_Cor*gamma_Cor*zcff) 255 END_2D 256 ! 257 !------------- 258 END DO ! end outer loop !<-- u_abl and v_abl are properly updated on (1:jpi) x (1:jpj) 259 !------------- 260 ! 261 IF( ln_geos_winds ) THEN 262 DO jj = 1, jpj ! outer loop 263 DO jk = 1, jpka 264 DO ji = 1, jpi 265 u_abl( ji, jj, jk, nt_a ) = u_abl( ji, jj, jk, nt_a ) & 266 & - rDt_abl * e3t_abl(jk) * fft_abl(ji , jj) * pgv_dta(ji ,jj ,jk) 267 v_abl( ji, jj, jk, nt_a ) = v_abl( ji, jj, jk, nt_a ) & 268 & + rDt_abl * e3t_abl(jk) * fft_abl(ji, jj ) * pgu_dta(ji ,jj ,jk) 269 END DO 270 END DO 271 END DO 272 END IF 273 !------------- 274 ! 275 IF( ln_hpgls_frc ) THEN 276 DO jj = 1, jpj ! outer loop 277 DO jk = 1, jpka 278 DO ji = 1, jpi 279 u_abl( ji, jj, jk, nt_a ) = u_abl( ji, jj, jk, nt_a ) - rDt_abl * e3t_abl(jk) * pgu_dta(ji,jj,jk) 280 v_abl( ji, jj, jk, nt_a ) = v_abl( ji, jj, jk, nt_a ) - rDt_abl * e3t_abl(jk) * pgv_dta(ji,jj,jk) 255 v_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *( & 256 & (1._wp-gamma_Cor*(1._wp-gamma_Cor)*zcff) * v_abl( ji, jj, jk, nt_n ) & 257 & - rDt_abl * fft_abl(ji, jj) * u_abl( ji, jj, jk, nt_n ) ) & 258 & / (1._wp + gamma_Cor*gamma_Cor*zcff) 259 END_2D 260 ! 261 !------------- 262 END DO ! end outer loop !<-- u_abl and v_abl are properly updated on (1:jpi) x (1:jpj) 263 !------------- 264 ! 265 IF( ln_geos_winds ) THEN 266 DO jj = 1, jpj ! outer loop 267 DO jk = 1, jpka 268 DO ji = 1, jpi 269 u_abl( ji, jj, jk, nt_a ) = u_abl( ji, jj, jk, nt_a ) & 270 & - rDt_abl * e3t_abl(jk) * fft_abl(ji , jj) * pgv_dta(ji ,jj ,jk) 271 v_abl( ji, jj, jk, nt_a ) = v_abl( ji, jj, jk, nt_a ) & 272 & + rDt_abl * e3t_abl(jk) * fft_abl(ji, jj ) * pgu_dta(ji ,jj ,jk) 273 END DO 274 END DO 275 END DO 276 END IF 277 ! 278 IF( ln_hpgls_frc ) THEN 279 DO jj = 1, jpj ! outer loop 280 DO jk = 1, jpka 281 DO ji = 1, jpi 282 u_abl( ji, jj, jk, nt_a ) = u_abl( ji, jj, jk, nt_a ) - rDt_abl * e3t_abl(jk) * pgu_dta(ji,jj,jk) 283 v_abl( ji, jj, jk, nt_a ) = v_abl( ji, jj, jk, nt_a ) - rDt_abl * e3t_abl(jk) * pgv_dta(ji,jj,jk) 284 ENDDO 281 285 ENDDO 282 286 ENDDO 283 ENDDO 284 END IF 285 286 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 287 ! ! 4 *** Advance u,v to time n+1 288 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 289 ! 290 ! Vertical diffusion for u_abl 287 END IF 288 289 ELSE ! SemiImp_Cor = .FALSE. 290 291 IF( ln_geos_winds ) THEN 292 293 !------------- 294 DO jk = 2, jpka ! outer loop 295 !------------- 296 ! 297 IF( MOD( kt, 2 ) == 0 ) then 298 ! Advance u_abl & v_abl to time n+1 299 DO jj = 1, jpj 300 DO ji = 1, jpi 301 zcff = fft_abl(ji,jj) * ( v_abl ( ji , jj , jk, nt_n ) - pgv_dta(ji ,jj ,jk) ) 302 u_abl( ji, jj, jk, nt_a ) = u_abl( ji, jj, jk, nt_n ) + rDt_abl * zcff 303 zcff = fft_abl(ji,jj) * ( u_abl ( ji , jj , jk, nt_a ) - pgu_dta(ji ,jj ,jk) ) 304 v_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *( v_abl( ji, jj, jk, nt_n ) - rDt_abl * zcff ) 305 u_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) * u_abl( ji, jj, jk, nt_a ) 306 END DO 307 END DO 308 ELSE 309 DO jj = 1, jpj 310 DO ji = 1, jpi 311 zcff = fft_abl(ji,jj) * ( u_abl ( ji , jj , jk, nt_n ) - pgu_dta(ji ,jj ,jk) ) 312 v_abl( ji, jj, jk, nt_a ) = v_abl( ji, jj, jk, nt_n ) - rDt_abl * zcff 313 zcff = fft_abl(ji,jj) * ( v_abl ( ji , jj , jk, nt_a ) - pgv_dta(ji ,jj ,jk) ) 314 u_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) *( u_abl( ji, jj, jk, nt_n ) + rDt_abl * zcff ) 315 v_abl( ji, jj, jk, nt_a ) = e3t_abl(jk) * v_abl( ji, jj, jk, nt_a ) 316 END DO 317 END DO 318 END IF 319 ! 320 !------------- 321 END DO ! end outer loop !<-- u_abl and v_abl are properly updated on (1:jpi) x (1:jpj) 322 !------------- 323 324 ENDIF ! ln_geos_winds 325 326 ENDIF ! SemiImp_Cor 327 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 328 ! ! 4 *** Advance u,v to time n+1 329 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 330 ! 331 ! Vertical diffusion for u_abl 291 332 !------------- 292 333 DO jj = 1, jpj ! outer loop 293 !------------- 334 !------------- 294 335 295 336 DO jk = 3, jpkam1 296 DO ji = 1, jpi 297 z_elem_a( ji, 298 z_elem_c( ji, jk ) = - rDt_abl * Avm_abl( ji, jj, jk ) / e3w_abl( jk ) ! upper-diagonal299 z_elem_b( ji, jk ) = e3t_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk )! diagonal300 END DO 301 END DO 302 303 DO ji = 2, jpi ! boundary conditions (Avm_abl and pcd_du must be available at ji=jpi) 337 DO ji = 1, jpi 338 z_elem_a( ji, jk ) = - rDt_abl * Avm_abl( ji, jj, jk-1 ) / e3w_abl( jk-1 ) ! lower-diagonal 339 z_elem_c( ji, jk ) = - rDt_abl * Avm_abl( ji, jj, jk ) / e3w_abl( jk ) ! upper-diagonal 340 z_elem_b( ji, jk ) = e3t_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk ) ! diagonal 341 END DO 342 END DO 343 344 DO ji = 2, jpi ! boundary conditions (Avm_abl and pcd_du must be available at ji=jpi) 304 345 !++ Surface boundary condition 305 z_elem_a( ji, 2) = 0._wp306 z_elem_c( ji, 2 ) = - rDt_abl * Avm_abl( ji, jj, 2 ) / e3w_abl( 2 )307 ! 308 309 zztmp2 = 0.5_wp * pcd_du(ji, jj) * ( pssu(ji-1, jj) + pssu(ji,jj) ) 310 #if defined key_si3 346 z_elem_a( ji, 2 ) = 0._wp 347 z_elem_c( ji, 2 ) = - rDt_abl * Avm_abl( ji, jj, 2 ) / e3w_abl( 2 ) 348 ! 349 zztmp1 = pcd_du(ji, jj) 350 zztmp2 = 0.5_wp * pcd_du(ji, jj) * ( pssu(ji-1, jj) + pssu(ji,jj) ) * rn_vfac 351 #if defined key_si3 311 352 zztmp1 = zztmp1 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * pcd_du_ice(ji, jj) 312 zzice = 0.5_wp * ( pssu_ice(ji-1, jj) + pssu_ice(ji,jj) ) 313 314 #endif 315 z_elem_b( ji, 2 ) = e3t_abl( 2 ) - z_elem_c( ji, 2 ) + rDt_abl * zztmp1 353 zzice = 0.5_wp * ( pssu_ice(ji-1, jj) + pssu_ice(ji, jj) ) * rn_vfac 354 zztmp2 = zztmp2 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * pcd_du_ice(ji, jj) * zzice 355 #endif 356 z_elem_b( ji, 2 ) = e3t_abl( 2 ) - z_elem_c( ji, 2 ) + rDt_abl * zztmp1 316 357 u_abl( ji, jj, 2, nt_a ) = u_abl( ji, jj, 2, nt_a ) + rDt_abl * zztmp2 317 318 !++ Top Neumann B.C. 319 !z_elem_a( ji, jpka ) = - 0.5_wp * rDt_abl * ( Avm_abl( ji, jj, jpka )+ Avm_abl( ji+1, jj, jpka ) ) / e3w_abl( jpka ) 320 !z_elem_c( ji, jpka ) = 0._wp 321 !z_elem_b( ji, jpka ) = e3t_abl( jpka ) - z_elem_a( ji, jpka ) 322 !++ Top Dirichlet B.C. 323 z_elem_a( ji, jpka ) = 0._wp 324 z_elem_c( ji, jpka ) = 0._wp 325 z_elem_b( ji, jpka ) = e3t_abl( jpka ) 326 u_abl ( ji, jj, jpka, nt_a ) = e3t_abl( jpka ) * pu_dta(ji,jj,jk) 327 END DO 358 359 ! idealized test cases only 360 !IF( ln_topbc_neumann ) THEN 361 ! !++ Top Neumann B.C. 362 ! z_elem_a( ji, jpka ) = - rDt_abl * Avm_abl( ji, jj, jpka ) / e3w_abl( jpka ) 363 ! z_elem_c( ji, jpka ) = 0._wp 364 ! z_elem_b( ji, jpka ) = e3t_abl( jpka ) - z_elem_a( ji, jpka ) 365 ! !u_abl ( ji, jj, jpka, nt_a ) = e3t_abl( jpka ) * u_abl ( ji, jj, jpka, nt_a ) 366 !ELSE 367 !++ Top Dirichlet B.C. 368 z_elem_a( ji, jpka ) = 0._wp 369 z_elem_c( ji, jpka ) = 0._wp 370 z_elem_b( ji, jpka ) = e3t_abl( jpka ) 371 u_abl ( ji, jj, jpka, nt_a ) = e3t_abl( jpka ) * pu_dta(ji,jj,jk) 372 !ENDIF 373 374 END DO 328 375 !! 329 376 !! Matrix inversion 330 377 !! ---------------------------------------------------------- 331 DO ji = 2, jpi 378 !DO ji = 2, jpi 379 DO ji = 1, jpi !!GS: TBI 332 380 zcff = 1._wp / z_elem_b( ji, 2 ) 333 zCF (ji, 2 ) = - zcff * z_elem_c( ji, 2 ) 381 zCF (ji, 2 ) = - zcff * z_elem_c( ji, 2 ) 334 382 u_abl (ji,jj,2,nt_a) = zcff * u_abl(ji,jj,2,nt_a) 335 END DO 336 337 DO jk = 3, jpka 338 DO ji = 2, jpi 383 END DO 384 385 DO jk = 3, jpka 386 DO ji = 2, jpi 339 387 zcff = 1._wp / ( z_elem_b( ji, jk ) + z_elem_a( ji, jk ) * zCF (ji, jk-1 ) ) 340 388 zCF(ji,jk) = - zcff * z_elem_c( ji, jk ) … … 343 391 END DO 344 392 END DO 345 346 DO jk = jpkam1,2,-1 393 394 DO jk = jpkam1,2,-1 347 395 DO ji = 2, jpi 348 396 u_abl(ji,jj,jk,nt_a) = u_abl(ji,jj,jk,nt_a) + zCF(ji,jk) * u_abl(ji,jj,jk+1,nt_a) 349 397 END DO 350 398 END DO 351 352 !------------- 353 END DO ! end outer loop 354 !------------- 355 356 ! 357 ! Vertical diffusion for v_abl 399 400 !------------- 401 END DO ! end outer loop 402 !------------- 403 404 ! 405 ! Vertical diffusion for v_abl 358 406 !------------- 359 407 DO jj = 2, jpj ! outer loop 360 !------------- 408 !------------- 361 409 ! 362 410 DO jk = 3, jpkam1 363 DO ji = 1, jpi 364 z_elem_a( ji, 365 z_elem_c( ji, jk ) = -rDt_abl * Avm_abl( ji, jj, jk ) / e3w_abl( jk ) ! upper-diagonal366 z_elem_b( ji, 367 END DO 368 END DO 369 370 DO ji = 1, jpi ! boundary conditions (Avm_abl and pcd_du must be available at jj=jpj) 411 DO ji = 1, jpi 412 z_elem_a( ji, jk ) = -rDt_abl * Avm_abl( ji, jj, jk-1 ) / e3w_abl( jk-1 ) ! lower-diagonal 413 z_elem_c( ji, jk ) = -rDt_abl * Avm_abl( ji, jj, jk ) / e3w_abl( jk ) ! upper-diagonal 414 z_elem_b( ji, jk ) = e3t_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk ) ! diagonal 415 END DO 416 END DO 417 418 DO ji = 1, jpi ! boundary conditions (Avm_abl and pcd_du must be available at jj=jpj) 371 419 !++ Surface boundary condition 372 z_elem_a( ji, 2) = 0._wp373 z_elem_c( ji, 2 ) = - rDt_abl * Avm_abl( ji, jj, 2 ) / e3w_abl( 2 )374 ! 375 376 zztmp2 = 0.5_wp * pcd_du(ji, jj) * ( pssv(ji, jj) + pssv(ji, jj-1) ) 377 #if defined key_si3 420 z_elem_a( ji, 2 ) = 0._wp 421 z_elem_c( ji, 2 ) = - rDt_abl * Avm_abl( ji, jj, 2 ) / e3w_abl( 2 ) 422 ! 423 zztmp1 = pcd_du(ji, jj) 424 zztmp2 = 0.5_wp * pcd_du(ji, jj) * ( pssv(ji, jj) + pssv(ji, jj-1) ) * rn_vfac 425 #if defined key_si3 378 426 zztmp1 = zztmp1 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * pcd_du_ice(ji, jj) 379 zzice = 0.5_wp * ( pssv_ice(ji, jj) + pssv_ice(ji,jj-1) ) 380 381 #endif 382 z_elem_b( ji, 2 ) = e3t_abl( 2 ) - z_elem_c( ji, 2 ) + rDt_abl * zztmp1 427 zzice = 0.5_wp * ( pssv_ice(ji, jj) + pssv_ice(ji, jj-1) ) * rn_vfac 428 zztmp2 = zztmp2 * pfrac_oce(ji,jj) + (1._wp - pfrac_oce(ji,jj)) * pcd_du_ice(ji, jj) * zzice 429 #endif 430 z_elem_b( ji, 2 ) = e3t_abl( 2 ) - z_elem_c( ji, 2 ) + rDt_abl * zztmp1 383 431 v_abl( ji, jj, 2, nt_a ) = v_abl( ji, jj, 2, nt_a ) + rDt_abl * zztmp2 384 !++ Top Neumann B.C. 385 !z_elem_a( ji, jpka ) = -rDt_abl * Avm_abl( ji, jj, jpka ) / e3w_abl( jpka ) 386 !z_elem_c( ji, jpka ) = 0._wp 387 !z_elem_b( ji, jpka ) = e3t_abl( jpka ) - z_elem_a( ji, jpka ) 388 !++ Top Dirichlet B.C. 389 z_elem_a( ji, jpka ) = 0._wp 390 z_elem_c( ji, jpka ) = 0._wp 391 z_elem_b( ji, jpka ) = e3t_abl( jpka ) 392 v_abl ( ji, jj, jpka, nt_a ) = e3t_abl( jpka ) * pv_dta(ji,jj,jk) 393 END DO 432 433 ! idealized test cases only 434 !IF( ln_topbc_neumann ) THEN 435 ! !++ Top Neumann B.C. 436 ! z_elem_a( ji, jpka ) = - rDt_abl * Avm_abl( ji, jj, jpka ) / e3w_abl( jpka ) 437 ! z_elem_c( ji, jpka ) = 0._wp 438 ! z_elem_b( ji, jpka ) = e3t_abl( jpka ) - z_elem_a( ji, jpka ) 439 ! !v_abl ( ji, jj, jpka, nt_a ) = e3t_abl( jpka ) * v_abl ( ji, jj, jpka, nt_a ) 440 !ELSE 441 !++ Top Dirichlet B.C. 442 z_elem_a( ji, jpka ) = 0._wp 443 z_elem_c( ji, jpka ) = 0._wp 444 z_elem_b( ji, jpka ) = e3t_abl( jpka ) 445 v_abl ( ji, jj, jpka, nt_a ) = e3t_abl( jpka ) * pv_dta(ji,jj,jk) 446 !ENDIF 447 448 END DO 394 449 !! 395 450 !! Matrix inversion 396 451 !! ---------------------------------------------------------- 397 DO ji = 1, jpi 452 DO ji = 1, jpi 398 453 zcff = 1._wp / z_elem_b( ji, 2 ) 399 zCF (ji, 2 ) = - zcff * z_elem_c( ji, 2 ) 400 v_abl (ji,jj,2,nt_a) = zcff * v_abl ( ji, jj, 2, nt_a ) 401 END DO 402 403 DO jk = 3, jpka 404 DO ji = 1, jpi 454 zCF (ji, 2 ) = - zcff * z_elem_c( ji, 2 ) 455 v_abl (ji,jj,2,nt_a) = zcff * v_abl ( ji, jj, 2, nt_a ) 456 END DO 457 458 DO jk = 3, jpka 459 DO ji = 1, jpi 405 460 zcff = 1._wp / ( z_elem_b( ji, jk ) + z_elem_a( ji, jk ) * zCF (ji, jk-1 ) ) 406 461 zCF(ji,jk) = - zcff * z_elem_c( ji, jk ) … … 409 464 END DO 410 465 END DO 411 412 DO jk = jpkam1,2,-1 413 DO ji = 1, jpi 466 467 DO jk = jpkam1,2,-1 468 DO ji = 1, jpi 414 469 v_abl(ji,jj,jk,nt_a) = v_abl(ji,jj,jk,nt_a) + zCF(ji,jk) * v_abl(ji,jj,jk+1,nt_a) 415 470 END DO 416 471 END DO 417 ! 418 !------------- 419 END DO ! end outer loop 420 !------------- 421 422 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 423 ! ! 5 *** Apply nudging on the dynamics and the tracers 424 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 425 z_cft(:,:,:) = 0._wp 426 472 ! 473 !------------- 474 END DO ! end outer loop 475 !------------- 476 477 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 478 ! ! 5 *** Apply nudging on the dynamics and the tracers 479 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 480 427 481 IF( nn_dyn_restore > 0 ) THEN 428 !------------- 482 !------------- 429 483 DO jk = 2, jpka ! outer loop 430 !------------- 484 !------------- 431 485 DO_2D_01_01 432 486 zcff1 = pblh( ji, jj ) 433 zsig = ght_abl(jk) / MAX( jp_pblh_min, MIN( jp_pblh_max, zcff1 ) ) 434 zsig = MIN( jp_bmax , MAX( zsig, jp_bmin) ) 487 zsig = ght_abl(jk) / MAX( jp_pblh_min, MIN( jp_pblh_max, zcff1 ) ) 488 zsig = MIN( jp_bmax , MAX( zsig, jp_bmin) ) 435 489 zmsk = msk_abl(ji,jj) 436 490 zcff2 = jp_alp3_dyn * zsig**3 + jp_alp2_dyn * zsig**2 & 437 491 & + jp_alp1_dyn * zsig + jp_alp0_dyn 438 492 zcff = (1._wp-zmsk) + zmsk * zcff2 * rn_Dt ! zcff = 1 for masked points 439 ! rn_Dt = rDt_abl / nn_fsbc 493 ! rn_Dt = rDt_abl / nn_fsbc 440 494 zcff = zcff * rest_eq(ji,jj) 441 z_cft( ji, jj, jk ) = zcff442 495 u_abl( ji, jj, jk, nt_a ) = (1._wp - zcff ) * u_abl( ji, jj, jk, nt_a ) & 443 & + zcff * pu_dta( ji, jj, jk ) 496 & + zcff * pu_dta( ji, jj, jk ) 444 497 v_abl( ji, jj, jk, nt_a ) = (1._wp - zcff ) * v_abl( ji, jj, jk, nt_a ) & 445 498 & + zcff * pv_dta( ji, jj, jk ) … … 447 500 !------------- 448 501 END DO ! end outer loop 449 !------------- 502 !------------- 450 503 END IF 451 504 452 !------------- 505 !------------- 453 506 DO jk = 2, jpka ! outer loop 454 !------------- 507 !------------- 455 508 DO_2D_11_11 456 509 zcff1 = pblh( ji, jj ) 457 510 zsig = ght_abl(jk) / MAX( jp_pblh_min, MIN( jp_pblh_max, zcff1 ) ) 458 zsig = MIN( jp_bmax , MAX( zsig, jp_bmin) ) 511 zsig = MIN( jp_bmax , MAX( zsig, jp_bmin) ) 459 512 zmsk = msk_abl(ji,jj) 460 513 zcff2 = jp_alp3_tra * zsig**3 + jp_alp2_tra * zsig**2 & 461 514 & + jp_alp1_tra * zsig + jp_alp0_tra 462 515 zcff = (1._wp-zmsk) + zmsk * zcff2 * rn_Dt ! zcff = 1 for masked points 463 ! rn_Dt = rDt_abl / nn_fsbc 464 !z_cft( ji, jj, jk ) = zcff 516 ! rn_Dt = rDt_abl / nn_fsbc 465 517 tq_abl( ji, jj, jk, nt_a, jp_ta ) = (1._wp - zcff ) * tq_abl( ji, jj, jk, nt_a, jp_ta ) & 466 518 & + zcff * pt_dta( ji, jj, jk ) 467 519 468 520 tq_abl( ji, jj, jk, nt_a, jp_qa ) = (1._wp - zcff ) * tq_abl( ji, jj, jk, nt_a, jp_qa ) & 469 521 & + zcff * pq_dta( ji, jj, jk ) 470 522 471 523 END_2D 472 524 !------------- 473 525 END DO ! end outer loop 474 !------------- 475 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 476 ! ! 6 *** MPI exchanges 477 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 478 ! 479 CALL lbc_lnk_multi( 'ablmod', u_abl(:,:,:,nt_a ), 'T', -1., v_abl(:,:,:,nt_a ), 'T', -1.)526 !------------- 527 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 528 ! ! 6 *** MPI exchanges 529 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 530 ! 531 CALL lbc_lnk_multi( 'ablmod', u_abl(:,:,:,nt_a ), 'T', -1., v_abl(:,:,:,nt_a) , 'T', -1. ) 480 532 CALL lbc_lnk_multi( 'ablmod', tq_abl(:,:,:,nt_a,jp_ta), 'T', 1., tq_abl(:,:,:,nt_a,jp_qa), 'T', 1., kfillmode = jpfillnothing ) ! ++++ this should not be needed... 481 533 ! 482 ! first ABL level 534 #if defined key_iomput 535 ! 2D & first ABL level 536 IF ( iom_use("pblh" ) ) CALL iom_put ( "pblh", pblh(:,: ) ) 483 537 IF ( iom_use("uz1_abl") ) CALL iom_put ( "uz1_abl", u_abl(:,:,2,nt_a ) ) 484 538 IF ( iom_use("vz1_abl") ) CALL iom_put ( "vz1_abl", v_abl(:,:,2,nt_a ) ) … … 489 543 IF ( iom_use("tz1_dta") ) CALL iom_put ( "tz1_dta", pt_dta(:,:,2 ) ) 490 544 IF ( iom_use("qz1_dta") ) CALL iom_put ( "qz1_dta", pq_dta(:,:,2 ) ) 491 ! all ABL levels 492 IF ( iom_use("u_abl" ) ) CALL iom_put ( "u_abl" , u_abl(:,:,2:jpka,nt_a ) ) 493 IF ( iom_use("v_abl" ) ) CALL iom_put ( "v_abl" , v_abl(:,:,2:jpka,nt_a ) ) 494 IF ( iom_use("t_abl" ) ) CALL iom_put ( "t_abl" , tq_abl(:,:,2:jpka,nt_a,jp_ta) ) 495 IF ( iom_use("q_abl" ) ) CALL iom_put ( "q_abl" , tq_abl(:,:,2:jpka,nt_a,jp_qa) ) 496 IF ( iom_use("tke_abl") ) CALL iom_put ( "tke_abl", tke_abl(:,:,2:jpka,nt_a ) ) 497 IF ( iom_use("avm_abl") ) CALL iom_put ( "avm_abl", avm_abl(:,:,2:jpka ) ) 498 IF ( iom_use("avt_abl") ) CALL iom_put ( "avt_abl", avm_abl(:,:,2:jpka ) ) 499 IF ( iom_use("mxl_abl") ) CALL iom_put ( "mxl_abl", mxl_abl(:,:,2:jpka ) ) 500 IF ( iom_use("pblh" ) ) CALL iom_put ( "pblh" , pblh(:,: ) ) 501 ! debug (to be removed) 545 ! debug 2D 546 IF( ln_geos_winds ) THEN 547 IF ( iom_use("uz1_geo") ) CALL iom_put ( "uz1_geo", pgu_dta(:,:,2) ) 548 IF ( iom_use("vz1_geo") ) CALL iom_put ( "vz1_geo", pgv_dta(:,:,2) ) 549 END IF 550 IF( ln_hpgls_frc ) THEN 551 IF ( iom_use("uz1_geo") ) CALL iom_put ( "uz1_geo", pgu_dta(:,:,2)/MAX(fft_abl(:,:),2.5e-5_wp) ) 552 IF ( iom_use("vz1_geo") ) CALL iom_put ( "vz1_geo", -pgv_dta(:,:,2)/MAX(fft_abl(:,:),2.5e-5_wp) ) 553 END IF 554 ! 3D (all ABL levels) 555 IF ( iom_use("u_abl" ) ) CALL iom_put ( "u_abl" , u_abl(:,:,2:jpka,nt_a ) ) 556 IF ( iom_use("v_abl" ) ) CALL iom_put ( "v_abl" , v_abl(:,:,2:jpka,nt_a ) ) 557 IF ( iom_use("t_abl" ) ) CALL iom_put ( "t_abl" , tq_abl(:,:,2:jpka,nt_a,jp_ta) ) 558 IF ( iom_use("q_abl" ) ) CALL iom_put ( "q_abl" , tq_abl(:,:,2:jpka,nt_a,jp_qa) ) 559 IF ( iom_use("tke_abl" ) ) CALL iom_put ( "tke_abl" , tke_abl(:,:,2:jpka,nt_a ) ) 560 IF ( iom_use("avm_abl" ) ) CALL iom_put ( "avm_abl" , avm_abl(:,:,2:jpka ) ) 561 IF ( iom_use("avt_abl" ) ) CALL iom_put ( "avt_abl" , avt_abl(:,:,2:jpka ) ) 562 IF ( iom_use("mxlm_abl") ) CALL iom_put ( "mxlm_abl", mxlm_abl(:,:,2:jpka ) ) 563 IF ( iom_use("mxld_abl") ) CALL iom_put ( "mxld_abl", mxld_abl(:,:,2:jpka ) ) 564 ! debug 3D 502 565 IF ( iom_use("u_dta") ) CALL iom_put ( "u_dta", pu_dta(:,:,2:jpka) ) 503 566 IF ( iom_use("v_dta") ) CALL iom_put ( "v_dta", pv_dta(:,:,2:jpka) ) 504 567 IF ( iom_use("t_dta") ) CALL iom_put ( "t_dta", pt_dta(:,:,2:jpka) ) 505 568 IF ( iom_use("q_dta") ) CALL iom_put ( "q_dta", pq_dta(:,:,2:jpka) ) 506 IF ( iom_use("coeft") ) CALL iom_put ( "coeft", z_cft(:,:,2:jpka) )507 569 IF( ln_geos_winds ) THEN 508 IF ( iom_use("u z1_geo") ) CALL iom_put ( "uz1_geo", pgu_dta(:,:,2) )509 IF ( iom_use("v z1_geo") ) CALL iom_put ( "vz1_geo", pgv_dta(:,:,2) )570 IF ( iom_use("u_geo") ) CALL iom_put ( "u_geo", pgu_dta(:,:,2:jpka) ) 571 IF ( iom_use("v_geo") ) CALL iom_put ( "v_geo", pgv_dta(:,:,2:jpka) ) 510 572 END IF 511 573 IF( ln_hpgls_frc ) THEN 512 IF ( iom_use("u z1_geo") ) CALL iom_put ( "uz1_geo", pgu_dta(:,:,2)/MAX(fft_abl(:,:),2.5e-5_wp))513 IF ( iom_use("v z1_geo") ) CALL iom_put ( "vz1_geo", -pgv_dta(:,:,2)/MAX(fft_abl(:,:),2.5e-5_wp))574 IF ( iom_use("u_geo") ) CALL iom_put ( "u_geo", pgu_dta(:,:,2:jpka)/MAX( RESHAPE( fft_abl(:,:), (/jpi,jpj,jpka-1/), fft_abl(:,:)), 2.5e-5_wp) ) 575 IF ( iom_use("v_geo") ) CALL iom_put ( "v_geo", -pgv_dta(:,:,2:jpka)/MAX( RESHAPE( fft_abl(:,:), (/jpi,jpj,jpka-1/), fft_abl(:,:)), 2.5e-5_wp) ) 514 576 END IF 515 ! 577 #endif 516 578 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 517 579 ! ! 7 *** Finalize flux computation 518 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 519 580 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 581 ! 520 582 DO_2D_11_11 521 ztemp = tq_abl ( ji, jj, 2, nt_a, jp_ta ) 522 zhumi = tq_abl ( ji, jj, 2, nt_a, jp_qa ) 523 !zcff = pslp_dta( ji, jj ) / & !<-- At this point ztemp and zhumi should not be zero ... 524 ! & ( R_dry*ztemp * ( 1._wp + rctv0*zhumi ) ) 525 zcff = rho_air( ztemp, zhumi, pslp_dta( ji, jj ) ) 526 psen ( ji, jj ) = cp_air(zhumi) * zcff * psen(ji,jj) * ( psst(ji,jj) + rt0 - ztemp ) 527 pevp ( ji, jj ) = rn_efac*MAX( 0._wp, zcff * pevp(ji,jj) * ( pssq(ji,jj) - zhumi ) ) 528 rhoa( ji, jj ) = zcff 583 ztemp = tq_abl( ji, jj, 2, nt_a, jp_ta ) 584 zhumi = tq_abl( ji, jj, 2, nt_a, jp_qa ) 585 zcff = rho_air( ztemp, zhumi, pslp_dta( ji, jj ) ) 586 psen( ji, jj ) = - cp_air(zhumi) * zcff * psen(ji,jj) * ( psst(ji,jj) + rt0 - ztemp ) !GS: negative sign to respect aerobulk convention 587 pevp( ji, jj ) = rn_efac*MAX( 0._wp, zcff * pevp(ji,jj) * ( pssq(ji,jj) - zhumi ) ) 588 rhoa( ji, jj ) = zcff 529 589 END_2D 530 590 531 591 DO_2D_01_01 592 <<<<<<< .working 593 zwnd_i(ji,jj) = u_abl(ji ,jj,2,nt_a) - 0.5_wp * ( pssu(ji ,jj) + pssu(ji-1,jj) ) 594 zwnd_j(ji,jj) = v_abl(ji,jj ,2,nt_a) - 0.5_wp * ( pssv(ji,jj ) + pssv(ji,jj-1) ) 595 ||||||| .merge-left.r13136 532 596 zwnd_i(ji,jj) = u_abl(ji ,jj,2,nt_a) - 0.5_wp * rn_vfac * ( pssu(ji ,jj) + pssu(ji-1,jj) ) 533 597 zwnd_j(ji,jj) = v_abl(ji,jj ,2,nt_a) - 0.5_wp * rn_vfac * ( pssv(ji,jj ) + pssv(ji,jj-1) ) 598 ======= 599 zwnd_i(ji,jj) = u_abl(ji ,jj,2,nt_a) - 0.5_wp * rn_vfac * ( pssu(ji,jj) + pssu(ji-1,jj ) ) 600 zwnd_j(ji,jj) = v_abl(ji,jj ,2,nt_a) - 0.5_wp * rn_vfac * ( pssv(ji,jj) + pssv(ji ,jj-1) ) 601 >>>>>>> .merge-right.r13211 534 602 END_2D 535 ! 603 ! 536 604 CALL lbc_lnk_multi( 'ablmod', zwnd_i(:,:) , 'T', -1., zwnd_j(:,:) , 'T', -1. ) 537 605 ! … … 539 607 DO_2D_11_11 540 608 zcff = SQRT( zwnd_i(ji,jj) * zwnd_i(ji,jj) & 541 & + zwnd_j(ji,jj) * zwnd_j(ji,jj) )! * msk_abl(ji,jj)609 & + zwnd_j(ji,jj) * zwnd_j(ji,jj) ) ! * msk_abl(ji,jj) 542 610 zztmp = rhoa(ji,jj) * pcd_du(ji,jj) 543 611 544 612 pwndm (ji,jj) = zcff 545 613 ptaum (ji,jj) = zztmp * zcff … … 564 632 565 633 IF(sn_cfctl%l_prtctl) THEN 566 CALL prt_ctl( tab2d_1=p wndm , clinfo1=' abl_stp: wndm : ' )567 CALL prt_ctl( tab2d_1=ptaui , clinfo1=' abl_stp: utau : ')568 CALL prt_ctl( tab2d_ 2=ptauj , clinfo2= 'vtau: ' )634 CALL prt_ctl( tab2d_1=ptaui , clinfo1=' abl_stp: utau : ', mask1=umask, & 635 & tab2d_2=ptauj , clinfo2=' vtau : ', mask2=vmask ) 636 CALL prt_ctl( tab2d_1=pwndm , clinfo1=' abl_stp: wndm : ' ) 569 637 ENDIF 570 638 571 639 #if defined key_si3 640 <<<<<<< .working 641 ! ------------------------------------------------------------ ! 642 ! Wind stress relative to the moving ice ( U10m - U_ice ) ! 643 ! ------------------------------------------------------------ ! 644 DO_2D_00_00 645 ptaui_ice(ji,jj) = 0.5_wp * ( rhoa(ji+1,jj) * pCd_du_ice(ji+1,jj) + rhoa(ji,jj) * pCd_du_ice(ji,jj) ) & 646 & * ( 0.5_wp * ( u_abl(ji+1,jj,2,nt_a) + u_abl(ji,jj,2,nt_a) ) - pssu_ice(ji,jj) ) 647 ptauj_ice(ji,jj) = 0.5_wp * ( rhoa(ji,jj+1) * pCd_du_ice(ji,jj+1) + rhoa(ji,jj) * pCd_du_ice(ji,jj) ) & 648 & * ( 0.5_wp * ( v_abl(ji,jj+1,2,nt_a) + v_abl(ji,jj,2,nt_a) ) - pssv_ice(ji,jj) ) 649 END_2D 650 CALL lbc_lnk_multi( 'ablmod', ptaui_ice, 'U', -1., ptauj_ice, 'V', -1. ) 651 ! 652 IF(sn_cfctl%l_prtctl) CALL prt_ctl( tab2d_1=ptaui_ice , clinfo1=' abl_stp: putaui : ' & 653 & , tab2d_2=ptauj_ice , clinfo2=' pvtaui : ' ) 654 ||||||| .merge-left.r13136 572 655 ! ------------------------------------------------------------ ! 573 656 ! Wind stress relative to the moving ice ( U10m - U_ice ) ! … … 589 672 IF(sn_cfctl%l_prtctl) CALL prt_ctl( tab2d_1=ptaui_ice , clinfo1=' abl_stp: putaui : ' & 590 673 & , tab2d_2=ptauj_ice , clinfo2=' pvtaui : ' ) 674 ======= 675 ! ------------------------------------------------------------ ! 676 ! Wind stress relative to the moving ice ( U10m - U_ice ) ! 677 ! ------------------------------------------------------------ ! 678 DO_2D_00_00 679 680 zztmp1 = 0.5_wp * ( u_abl(ji+1,jj ,2,nt_a) + u_abl(ji,jj,2,nt_a) ) 681 zztmp2 = 0.5_wp * ( v_abl(ji ,jj+1,2,nt_a) + v_abl(ji,jj,2,nt_a) ) 682 683 ptaui_ice(ji,jj) = 0.5_wp * ( rhoa(ji+1,jj) * pCd_du_ice(ji+1,jj) & 684 & + rhoa(ji ,jj) * pCd_du_ice(ji ,jj) ) & 685 & * ( zztmp1 - rn_vfac * pssu_ice(ji,jj) ) 686 ptauj_ice(ji,jj) = 0.5_wp * ( rhoa(ji,jj+1) * pCd_du_ice(ji,jj+1) & 687 & + rhoa(ji,jj ) * pCd_du_ice(ji,jj ) ) & 688 & * ( zztmp2 - rn_vfac * pssv_ice(ji,jj) ) 689 END_2D 690 CALL lbc_lnk_multi( 'ablmod', ptaui_ice, 'U', -1., ptauj_ice, 'V', -1. ) 691 ! 692 IF(sn_cfctl%l_prtctl) THEN 693 CALL prt_ctl( tab2d_1=ptaui_ice , clinfo1=' abl_stp: utau_ice : ', mask1=umask, & 694 & tab2d_2=ptauj_ice , clinfo2=' vtau_ice : ', mask2=vmask ) 695 END IF 696 >>>>>>> .merge-right.r13211 591 697 #endif 592 698 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< … … 599 705 END SUBROUTINE abl_stp 600 706 !=================================================================================================== 601 602 603 604 605 606 607 608 609 610 611 612 613 614 707 615 708 … … 634 727 !! (= Kz dz[Ub] * dz[Un] ) 635 728 !! --------------------------------------------------------------------- 636 INTEGER :: ji, jj, jk, tind, jbak, jkup, jkdwn 729 INTEGER :: ji, jj, jk, tind, jbak, jkup, jkdwn 637 730 INTEGER, DIMENSION(1:jpi ) :: ikbl 638 731 REAL(wp) :: zcff, zcff2, ztken, zesrf, zetop, ziRic, ztv 639 REAL(wp) :: zdU , zdV, zcff1,zshear,zbuoy,zsig, zustar2640 REAL(wp) :: zdU2, zdV2641 REAL(wp) :: zwndi, zwndj732 REAL(wp) :: zdU , zdV , zcff1, zshear, zbuoy, zsig, zustar2 733 REAL(wp) :: zdU2, zdV2, zbuoy1, zbuoy2 ! zbuoy for BL89 734 REAL(wp) :: zwndi, zwndj 642 735 REAL(wp), DIMENSION(1:jpi, 1:jpka) :: zsh2 643 736 REAL(wp), DIMENSION(1:jpi,1:jpj,1:jpka) :: zbn2 644 REAL(wp), DIMENSION(1:jpi,1:jpka ) :: zFC, zRH, zCF 737 REAL(wp), DIMENSION(1:jpi,1:jpka ) :: zFC, zRH, zCF 645 738 REAL(wp), DIMENSION(1:jpi,1:jpka ) :: z_elem_a 646 739 REAL(wp), DIMENSION(1:jpi,1:jpka ) :: z_elem_b … … 648 741 LOGICAL :: ln_Patankar = .FALSE. 649 742 LOGICAL :: ln_dumpvar = .FALSE. 650 LOGICAL , DIMENSION(1:jpi ) :: ln_foundl 743 LOGICAL , DIMENSION(1:jpi ) :: ln_foundl 651 744 ! 652 745 tind = nt_n … … 660 753 !------------- 661 754 ! 662 ! Compute vertical shear 755 ! Compute vertical shear 663 756 DO jk = 2, jpkam1 664 DO ji = 1, jpi665 zcff = 1.0_wp / e3w_abl( jk )**2 666 zdU = zcff* Avm_abl(ji,jj,jk) * (u_abl( ji, jj, jk+1, tind)-u_abl( ji, jj, jk , tind) )**2 757 DO ji = 1, jpi 758 zcff = 1.0_wp / e3w_abl( jk )**2 759 zdU = zcff* Avm_abl(ji,jj,jk) * (u_abl( ji, jj, jk+1, tind)-u_abl( ji, jj, jk , tind) )**2 667 760 zdV = zcff* Avm_abl(ji,jj,jk) * (v_abl( ji, jj, jk+1, tind)-v_abl( ji, jj, jk , tind) )**2 668 zsh2(ji,jk) = zdU+zdV 669 END DO 670 END DO 761 zsh2(ji,jk) = zdU+zdV !<-- zsh2 = Km ( ( du/dz )^2 + ( dv/dz )^2 ) 762 END DO 763 END DO 671 764 ! 672 765 ! Compute brunt-vaisala frequency 673 766 DO jk = 2, jpkam1 674 DO ji = 1,jpi 675 zcff = grav * itvref / e3w_abl( jk ) 767 DO ji = 1,jpi 768 zcff = grav * itvref / e3w_abl( jk ) 676 769 zcff1 = tq_abl( ji, jj, jk+1, tind, jp_ta) - tq_abl( ji, jj, jk , tind, jp_ta) 677 770 zcff2 = tq_abl( ji, jj, jk+1, tind, jp_ta) * tq_abl( ji, jj, jk+1, tind, jp_qa) & … … 679 772 zbn2(ji,jj,jk) = zcff * ( zcff1 + rctv0 * zcff2 ) !<-- zbn2 defined on (2,jpi) 680 773 END DO 681 END DO 774 END DO 682 775 ! 683 776 ! Terms for the tridiagonal problem 684 777 DO jk = 2, jpkam1 685 DO ji = 1, jpi686 zshear = zsh2( ji, jk )! zsh2 is already multiplied by Avm_abl at this point687 zsh2(ji,jk) = zsh2( ji, jk ) / Avm_abl( ji, jj, jk ) ! reformulate zsh2 as a 'true' vertical shear for PBLH computation688 zbuoy = - Avt_abl( ji, jj, jk ) * zbn2( ji, jj, jk )689 690 z_elem_a( ji, jk ) = - 0.5_wp * rDt_abl * rn_Sch * ( Avm_abl( ji, jj, jk )+Avm_abl( ji, jj, jk-1 ) ) / e3t_abl( jk ) ! lower-diagonal691 z_elem_c( ji, jk ) = - 0.5_wp * rDt_abl * rn_Sch * ( Avm_abl( ji, jj, jk )+Avm_abl( ji, jj, jk+1 ) ) / e3t_abl( jk+1 ) ! upper-diagonal778 DO ji = 1, jpi 779 zshear = zsh2( ji, jk ) ! zsh2 is already multiplied by Avm_abl at this point 780 zsh2(ji,jk) = zsh2( ji, jk ) / Avm_abl( ji, jj, jk ) ! reformulate zsh2 as a 'true' vertical shear for PBLH computation 781 zbuoy = - Avt_abl( ji, jj, jk ) * zbn2( ji, jj, jk ) 782 783 z_elem_a( ji, jk ) = - 0.5_wp * rDt_abl * rn_Sch * ( Avm_abl( ji, jj, jk ) + Avm_abl( ji, jj, jk-1 ) ) / e3t_abl( jk ) ! lower-diagonal 784 z_elem_c( ji, jk ) = - 0.5_wp * rDt_abl * rn_Sch * ( Avm_abl( ji, jj, jk ) + Avm_abl( ji, jj, jk+1 ) ) / e3t_abl( jk+1 ) ! upper-diagonal 692 785 IF( (zbuoy + zshear) .gt. 0.) THEN ! Patankar trick to avoid negative values of TKE 693 z_elem_b( ji, jk )= e3w_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk ) &694 & + e3w_abl(jk) * rDt_abl * rn_Ceps * sqrt(tke_abl( ji, jj, jk, nt_n )) / mxl_abl(ji,jj,jk) ! diagonal695 tke_abl( ji, jj, jk, nt_a ) = e3w_abl(jk) * ( tke_abl( ji, jj, jk, nt_n ) + rDt_abl * ( zbuoy + zshear ) )! right-hand-side786 z_elem_b( ji, jk ) = e3w_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk ) & 787 & + e3w_abl(jk) * rDt_abl * rn_Ceps * sqrt(tke_abl( ji, jj, jk, nt_n )) / mxld_abl(ji,jj,jk) ! diagonal 788 tke_abl( ji, jj, jk, nt_a ) = e3w_abl(jk) * ( tke_abl( ji, jj, jk, nt_n ) + rDt_abl * ( zbuoy + zshear ) ) ! right-hand-side 696 789 ELSE 697 z_elem_b( ji, jk )= e3w_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk ) &698 & + e3w_abl(jk) * rDt_abl * rn_Ceps * sqrt(tke_abl( ji, jj, jk, nt_n )) / mxl_abl(ji,jj,jk) & ! diagonal699 & - e3w_abl(jk) * rDt_abl * zbuoy700 tke_abl( ji, jj, jk, nt_a ) = e3w_abl(jk) * ( tke_abl( ji, jj, jk, nt_n ) + rDt_abl * zshear ) ! right-hand-side790 z_elem_b( ji, jk ) = e3w_abl(jk) - z_elem_a( ji, jk ) - z_elem_c( ji, jk ) & 791 & + e3w_abl(jk) * rDt_abl * rn_Ceps * sqrt(tke_abl( ji, jj, jk, nt_n )) / mxld_abl(ji,jj,jk) & ! diagonal 792 & - e3w_abl(jk) * rDt_abl * zbuoy 793 tke_abl( ji, jj, jk, nt_a ) = e3w_abl(jk) * ( tke_abl( ji, jj, jk, nt_n ) + rDt_abl * zshear ) ! right-hand-side 701 794 END IF 702 795 END DO 703 END DO 704 705 DO ji = 1,jpi ! vector opt. 706 zesrf = MAX( 4.63_wp * ustar2(ji,jj), tke_min ) 707 zetop = tke_min 708 z_elem_a ( ji, 1 ) = 0._wp; z_elem_c ( ji, 1 ) = 0._wp; z_elem_b ( ji, 1 ) = 1._wp 709 z_elem_a ( ji, jpka ) = 0._wp; z_elem_c ( ji, jpka ) = 0._wp; z_elem_b ( ji, jpka ) = 1._wp 710 tke_abl( ji, jj, 1, nt_a ) = zesrf 711 tke_abl( ji, jj, jpka, nt_a ) = zetop 712 zbn2(ji,jj, 1) = zbn2( ji,jj, 2) 713 zsh2(ji, 1) = zsh2( ji, 2) 714 zbn2(ji,jj,jpka) = zbn2( ji,jj,jpkam1) 715 zsh2(ji, jpka) = zsh2( ji , jpkam1) 716 END DO 796 END DO 797 798 DO ji = 1,jpi ! vector opt. 799 zesrf = MAX( rn_Esfc * ustar2(ji,jj), tke_min ) 800 zetop = tke_min 801 802 z_elem_a ( ji, 1 ) = 0._wp 803 z_elem_c ( ji, 1 ) = 0._wp 804 z_elem_b ( ji, 1 ) = 1._wp 805 tke_abl ( ji, jj, 1, nt_a ) = zesrf 806 807 !++ Top Neumann B.C. 808 !z_elem_a ( ji, jpka ) = - 0.5 * rDt_abl * rn_Sch * (Avm_abl(ji,jj, jpka-1 )+Avm_abl(ji,jj, jpka )) / e3t_abl( jpka ) 809 !z_elem_c ( ji, jpka ) = 0._wp 810 !z_elem_b ( ji, jpka ) = e3w_abl(jpka) - z_elem_a(ji, jpka ) 811 !tke_abl ( ji, jj, jpka, nt_a ) = e3w_abl(jpka) * tke_abl( ji,jj, jpka, nt_n ) 812 813 !++ Top Dirichlet B.C. 814 z_elem_a ( ji, jpka ) = 0._wp 815 z_elem_c ( ji, jpka ) = 0._wp 816 z_elem_b ( ji, jpka ) = 1._wp 817 tke_abl ( ji, jj, jpka, nt_a ) = zetop 818 819 zbn2 ( ji, jj, 1 ) = zbn2 ( ji, jj, 2 ) 820 zsh2 ( ji, 1 ) = zsh2 ( ji, 2 ) 821 zbn2 ( ji, jj, jpka ) = zbn2 ( ji, jj, jpkam1 ) 822 zsh2 ( ji, jpka ) = zsh2 ( ji , jpkam1 ) 823 END DO 717 824 !! 718 825 !! Matrix inversion … … 720 827 DO ji = 1,jpi 721 828 zcff = 1._wp / z_elem_b( ji, 1 ) 722 zCF (ji, 1 ) = - zcff * z_elem_c( ji, 1 ) 723 tke_abl(ji,jj,1,nt_a) = zcff * tke_abl ( ji, jj, 1, nt_a ) 724 END DO 725 726 DO jk = 2, jpka 829 zCF (ji, 1 ) = - zcff * z_elem_c( ji, 1 ) 830 tke_abl(ji,jj,1,nt_a) = zcff * tke_abl ( ji, jj, 1, nt_a ) 831 END DO 832 833 DO jk = 2, jpka 727 834 DO ji = 1,jpi 728 835 zcff = 1._wp / ( z_elem_b( ji, jk ) + z_elem_a( ji, jk ) * zCF(ji, jk-1 ) ) … … 732 839 END DO 733 840 END DO 734 735 DO jk = jpkam1,1,-1 841 842 DO jk = jpkam1,1,-1 736 843 DO ji = 1,jpi 737 844 tke_abl(ji,jj,jk,nt_a) = tke_abl(ji,jj,jk,nt_a) + zCF(ji,jk) * tke_abl(ji,jj,jk+1,nt_a) 738 845 END DO 739 846 END DO 740 741 !!FL should not be needed because of Patankar procedure 847 848 !!FL should not be needed because of Patankar procedure 742 849 tke_abl(2:jpi,jj,1:jpka,nt_a) = MAX( tke_abl(2:jpi,jj,1:jpka,nt_a), tke_min ) 743 850 … … 745 852 !! Diagnose PBL height 746 853 !! ---------------------------------------------------------- 747 748 749 ! 854 855 856 ! 750 857 ! arrays zRH, zFC and zCF are available at this point 751 858 ! and zFC(:, 1 ) = 0. 752 859 ! diagnose PBL height based on zsh2 and zbn2 753 860 zFC ( : ,1) = 0._wp 754 ikbl( 1:jpi ) = 0 755 861 ikbl( 1:jpi ) = 0 862 756 863 DO jk = 2,jpka 757 DO ji = 1, jpi 864 DO ji = 1, jpi 758 865 zcff = ghw_abl( jk-1 ) 759 866 zcff1 = zcff / ( zcff + rn_epssfc * pblh ( ji, jj ) ) … … 781 888 ELSE 782 889 pblh( ji, jj ) = ghw_abl(jpka) 783 END IF 784 END DO 785 !------------- 786 END DO 787 !------------- 788 ! 789 ! Optional : could add pblh smoothing if pblh is noisy horizontally ... 890 END IF 891 END DO 892 !------------- 893 END DO 894 !------------- 895 ! 896 ! Optional : could add pblh smoothing if pblh is noisy horizontally ... 790 897 IF(ln_smth_pblh) THEN 791 CALL lbc_lnk( 'ablmod', pblh, 'T', 1.) 898 CALL lbc_lnk( 'ablmod', pblh, 'T', 1.) !, kfillmode = jpfillnothing) 792 899 CALL smooth_pblh( pblh, msk_abl ) 793 CALL lbc_lnk( 'ablmod', pblh, 'T', 1.) 900 CALL lbc_lnk( 'ablmod', pblh, 'T', 1.) !, kfillmode = jpfillnothing) 794 901 ENDIF 795 902 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< … … 799 906 SELECT CASE ( nn_amxl ) 800 907 ! 801 CASE ( 0 ) ! Deardroff 80 length-scale bounded by the distance to surface and bottom 802 # define zlup zRH 803 # define zldw zFC 908 CASE ( 0 ) ! Deardroff 80 length-scale bounded by the distance to surface and bottom 909 # define zlup zRH 910 # define zldw zFC 804 911 DO jj = 1, jpj ! outer loop 805 912 ! 806 913 DO ji = 1, jpi 807 mxl_abl ( ji, jj, 1 ) = 0._wp 808 mxl_abl ( ji, jj, jpka ) = mxl_min 809 zldw( ji, 1 ) = 0._wp 810 zlup( ji, jpka ) = 0._wp 811 END DO 812 ! 813 DO jk = 2, jpkam1 814 DO ji = 1, jpi 815 zbuoy = MAX( zbn2(ji, jj, jk), rsmall ) 816 mxl_abl( ji, jj, jk ) = MAX( mxl_min, & 817 & SQRT( 2._wp * tke_abl( ji, jj, jk, nt_a ) / zbuoy ) ) 818 END DO 819 END DO 914 mxld_abl( ji, jj, 1 ) = mxl_min 915 mxld_abl( ji, jj, jpka ) = mxl_min 916 mxlm_abl( ji, jj, 1 ) = mxl_min 917 mxlm_abl( ji, jj, jpka ) = mxl_min 918 zldw ( ji, 1 ) = zrough(ji,jj) * rn_Lsfc 919 zlup ( ji, jpka ) = mxl_min 920 END DO 921 ! 922 DO jk = 2, jpkam1 923 DO ji = 1, jpi 924 zbuoy = MAX( zbn2(ji, jj, jk), rsmall ) 925 mxlm_abl( ji, jj, jk ) = MAX( mxl_min, & 926 & SQRT( 2._wp * tke_abl( ji, jj, jk, nt_a ) / zbuoy ) ) 927 END DO 928 END DO 820 929 ! 821 930 ! Limit mxl 822 DO jk = jpkam1,1,-1 823 DO ji = 1, jpi 824 zlup(ji,jk) = MIN( zlup(ji,jk+1) + (ghw_abl(jk+1)-ghw_abl(jk)) , mxl _abl(ji, jj, jk) )825 END DO 826 END DO 931 DO jk = jpkam1,1,-1 932 DO ji = 1, jpi 933 zlup(ji,jk) = MIN( zlup(ji,jk+1) + (ghw_abl(jk+1)-ghw_abl(jk)) , mxlm_abl(ji, jj, jk) ) 934 END DO 935 END DO 827 936 ! 828 937 DO jk = 2, jpka 829 DO ji = 1, jpi 830 zldw(ji,jk) = MIN( zldw(ji,jk-1) + (ghw_abl(jk)-ghw_abl(jk-1)) , mxl_abl(ji, jj, jk) ) 831 END DO 832 END DO 938 DO ji = 1, jpi 939 zldw(ji,jk) = MIN( zldw(ji,jk-1) + (ghw_abl(jk)-ghw_abl(jk-1)) , mxlm_abl(ji, jj, jk) ) 940 END DO 941 END DO 942 ! 943 ! DO jk = 1, jpka 944 ! DO ji = 1, jpi 945 ! mxlm_abl( ji, jj, jk ) = SQRT( zldw( ji, jk ) * zlup( ji, jk ) ) 946 ! mxld_abl( ji, jj, jk ) = MIN ( zldw( ji, jk ), zlup( ji, jk ) ) 947 ! END DO 948 ! END DO 833 949 ! 834 950 DO jk = 1, jpka 835 951 DO ji = 1, jpi 836 mxl_abl( ji, jj, jk ) = SQRT( zldw( ji, jk ) * zlup( ji, jk ) ) 837 END DO 838 END DO 839 ! 840 END DO 841 # undef zlup 842 # undef zldw 843 ! 844 ! 845 CASE ( 1 ) ! length-scale computed as the distance to the PBL height 846 DO jj = 1,jpj ! outer loop 847 ! 848 DO ji = 1, jpi ! vector opt. 849 zcff = 1._wp / pblh( ji, jj ) ! inverse of hbl 850 DO jk = 1, jpka 851 zsig = MIN( zcff * ghw_abl( jk ), 1. ) 852 zcff1 = pblh( ji, jj ) 853 mxl_abl( ji, jj, jk ) = mxl_min & 854 & + zsig * ( amx1*zcff1 + bmx1*mxl_min ) & 855 & + zsig * zsig * ( amx2*zcff1 + bmx2*mxl_min ) & 856 & + zsig**3 * ( amx3*zcff1 + bmx3*mxl_min ) & 857 & + zsig**4 * ( amx4*zcff1 + bmx4*mxl_min ) & 858 & + zsig**5 * ( amx5*zcff1 + bmx5*mxl_min ) 859 END DO 860 END DO 861 ! 862 END DO 952 ! zcff = 2.*SQRT(2.)*( zldw( ji, jk )**(-2._wp/3._wp) + zlup( ji, jk )**(-2._wp/3._wp) )**(-3._wp/2._wp) 953 zcff = SQRT( zldw( ji, jk ) * zlup( ji, jk ) ) 954 mxlm_abl( ji, jj, jk ) = MAX( zcff, mxl_min ) 955 mxld_abl( ji, jj, jk ) = MAX( MIN( zldw( ji, jk ), zlup( ji, jk ) ), mxl_min ) 956 END DO 957 END DO 958 ! 959 END DO 960 # undef zlup 961 # undef zldw 962 ! 963 ! 964 CASE ( 1 ) ! Modified Deardroff 80 length-scale bounded by the distance to surface and bottom 965 # define zlup zRH 966 # define zldw zFC 967 DO jj = 1, jpj ! outer loop 968 ! 969 DO jk = 2, jpkam1 970 DO ji = 1,jpi 971 zcff = 1.0_wp / e3w_abl( jk )**2 972 zdU = zcff* (u_abl( ji, jj, jk+1, tind)-u_abl( ji, jj, jk , tind) )**2 973 zdV = zcff* (v_abl( ji, jj, jk+1, tind)-v_abl( ji, jj, jk , tind) )**2 974 zsh2(ji,jk) = SQRT(zdU+zdV) !<-- zsh2 = SQRT ( ( du/dz )^2 + ( dv/dz )^2 ) 975 ENDDO 976 ENDDO 977 ! 978 DO ji = 1, jpi 979 zcff = zrough(ji,jj) * rn_Lsfc 980 mxld_abl ( ji, jj, 1 ) = zcff 981 mxld_abl ( ji, jj, jpka ) = mxl_min 982 mxlm_abl ( ji, jj, 1 ) = zcff 983 mxlm_abl ( ji, jj, jpka ) = mxl_min 984 zldw ( ji, 1 ) = zcff 985 zlup ( ji, jpka ) = mxl_min 986 END DO 987 ! 988 DO jk = 2, jpkam1 989 DO ji = 1, jpi 990 zbuoy = MAX( zbn2(ji, jj, jk), rsmall ) 991 zcff = 2.*SQRT(tke_abl( ji, jj, jk, nt_a )) / ( rn_Rod*zsh2(ji,jk) & 992 & + SQRT( rn_Rod*rn_Rod*zsh2(ji,jk)*zsh2(ji,jk)+2.*zbuoy ) ) 993 mxlm_abl( ji, jj, jk ) = MAX( mxl_min, zcff ) 994 END DO 995 END DO 996 ! 997 ! Limit mxl 998 DO jk = jpkam1,1,-1 999 DO ji = 1, jpi 1000 zlup(ji,jk) = MIN( zlup(ji,jk+1) + (ghw_abl(jk+1)-ghw_abl(jk)) , mxlm_abl(ji, jj, jk) ) 1001 END DO 1002 END DO 1003 ! 1004 DO jk = 2, jpka 1005 DO ji = 1, jpi 1006 zldw(ji,jk) = MIN( zldw(ji,jk-1) + (ghw_abl(jk)-ghw_abl(jk-1)) , mxlm_abl(ji, jj, jk) ) 1007 END DO 1008 END DO 1009 ! 1010 DO jk = 1, jpka 1011 DO ji = 1, jpi 1012 !mxlm_abl( ji, jj, jk ) = SQRT( zldw( ji, jk ) * zlup( ji, jk ) ) 1013 !zcff = 2.*SQRT(2.)*( zldw( ji, jk )**(-2._wp/3._wp) + zlup( ji, jk )**(-2._wp/3._wp) )**(-3._wp/2._wp) 1014 zcff = SQRT( zldw( ji, jk ) * zlup( ji, jk ) ) 1015 mxlm_abl( ji, jj, jk ) = MAX( zcff, mxl_min ) 1016 !mxld_abl( ji, jj, jk ) = MIN( zldw( ji, jk ), zlup( ji, jk ) ) 1017 mxld_abl( ji, jj, jk ) = MAX( MIN( zldw( ji, jk ), zlup( ji, jk ) ), mxl_min ) 1018 END DO 1019 END DO 1020 ! 1021 END DO 1022 # undef zlup 1023 # undef zldw 863 1024 ! 864 1025 CASE ( 2 ) ! Bougeault & Lacarrere 89 length-scale 865 1026 ! 866 # define zlup zRH 867 # define zldw zFC 1027 # define zlup zRH 1028 # define zldw zFC 868 1029 ! zCF is used for matrix inversion 869 ! 1030 ! 870 1031 DO jj = 1, jpj ! outer loop 871 872 DO ji = 1, jpi 873 zlup( ji, 1 ) = mxl_min 874 zldw( ji, 1 ) = mxl_min 1032 1033 DO ji = 1, jpi 1034 zcff = zrough(ji,jj) * rn_Lsfc 1035 zlup( ji, 1 ) = zcff 1036 zldw( ji, 1 ) = zcff 875 1037 zlup( ji, jpka ) = mxl_min 876 zldw( ji, jpka ) = mxl_min 877 END DO 878 1038 zldw( ji, jpka ) = mxl_min 1039 END DO 1040 879 1041 DO jk = 2,jpka-1 880 1042 DO ji = 1, jpi 881 1043 zlup(ji,jk) = ghw_abl(jpka) - ghw_abl(jk) 882 zldw(ji,jk) = ghw_abl(jk ) - ghw_abl( 1) 883 END DO 884 END DO 1044 zldw(ji,jk) = ghw_abl(jk ) - ghw_abl( 1) 1045 END DO 1046 END DO 885 1047 !! 886 1048 !! BL89 search for lup 887 !! ---------------------------------------------------------- 888 DO jk=2,jpka-1 1049 !! ---------------------------------------------------------- 1050 DO jk=2,jpka-1 889 1051 ! 890 1052 DO ji = 1, jpi … … 892 1054 zCF(ji, jk ) = - tke_abl( ji, jj, jk, nt_a ) 893 1055 ln_foundl(ji ) = .false. 894 END DO 895 ! 1056 END DO 1057 ! 896 1058 DO jkup=jk+1,jpka-1 897 1059 DO ji = 1, jpi 1060 zbuoy1 = MAX( zbn2(ji,jj,jkup ), rsmall ) 1061 zbuoy2 = MAX( zbn2(ji,jj,jkup-1), rsmall ) 898 1062 zCF (ji,jkup) = zCF (ji,jkup-1) + 0.5_wp * e3t_abl(jkup) * & 899 & ( zb n2(ji,jj,jkup )*(ghw_abl(jkup )-ghw_abl(jk)) &900 & + zb n2(ji,jj,jkup-1)*(ghw_abl(jkup-1)-ghw_abl(jk)) )1063 & ( zbuoy1*(ghw_abl(jkup )-ghw_abl(jk)) & 1064 & + zbuoy2*(ghw_abl(jkup-1)-ghw_abl(jk)) ) 901 1065 IF( zCF (ji,jkup) * zCF (ji,jkup-1) .le. 0._wp .and. .not. ln_foundl(ji) ) THEN 902 1066 zcff2 = ghw_abl(jkup ) - ghw_abl(jk) 903 zcff1 = ghw_abl(jkup-1) - ghw_abl(jk) 1067 zcff1 = ghw_abl(jkup-1) - ghw_abl(jk) 904 1068 zcff = ( zcff1 * zCF(ji,jkup) - zcff2 * zCF(ji,jkup-1) ) / & 905 & ( zCF(ji,jkup) - zCF(ji,jkup-1) ) 906 zlup(ji,jk) = zcff 1069 & ( zCF(ji,jkup) - zCF(ji,jkup-1) ) 1070 zlup(ji,jk) = zcff 1071 zlup(ji,jk) = ghw_abl(jkup ) - ghw_abl(jk) 907 1072 ln_foundl(ji) = .true. 908 1073 END IF … … 910 1075 END DO 911 1076 ! 912 END DO 1077 END DO 913 1078 !! 914 1079 !! BL89 search for ldwn 915 !! ---------------------------------------------------------- 916 DO jk=2,jpka-1 1080 !! ---------------------------------------------------------- 1081 DO jk=2,jpka-1 917 1082 ! 918 1083 DO ji = 1, jpi … … 920 1085 zCF(ji, jk ) = - tke_abl( ji, jj, jk, nt_a ) 921 1086 ln_foundl(ji ) = .false. 922 END DO 923 ! 1087 END DO 1088 ! 924 1089 DO jkdwn=jk-1,1,-1 925 DO ji = 1, jpi 1090 DO ji = 1, jpi 1091 zbuoy1 = MAX( zbn2(ji,jj,jkdwn+1), rsmall ) 1092 zbuoy2 = MAX( zbn2(ji,jj,jkdwn ), rsmall ) 926 1093 zCF (ji,jkdwn) = zCF (ji,jkdwn+1) + 0.5_wp * e3t_abl(jkdwn+1) & 927 & * ( zb n2(ji,jj,jkdwn+1)*(ghw_abl(jk)-ghw_abl(jkdwn+1)) &928 + zb n2(ji,jj,jkdwn )*(ghw_abl(jk)-ghw_abl(jkdwn )) )929 IF(zCF (ji,jkdwn) * zCF (ji,jkdwn+1) .le. 0._wp .and. .not. ln_foundl(ji) ) THEN 1094 & * ( zbuoy1*(ghw_abl(jk)-ghw_abl(jkdwn+1)) & 1095 + zbuoy2*(ghw_abl(jk)-ghw_abl(jkdwn )) ) 1096 IF(zCF (ji,jkdwn) * zCF (ji,jkdwn+1) .le. 0._wp .and. .not. ln_foundl(ji) ) THEN 930 1097 zcff2 = ghw_abl(jk) - ghw_abl(jkdwn+1) 931 zcff1 = ghw_abl(jk) - ghw_abl(jkdwn ) 1098 zcff1 = ghw_abl(jk) - ghw_abl(jkdwn ) 932 1099 zcff = ( zcff1 * zCF(ji,jkdwn+1) - zcff2 * zCF(ji,jkdwn) ) / & 933 & ( zCF(ji,jkdwn+1) - zCF(ji,jkdwn) ) 934 zldw(ji,jk) = zcff 935 ln_foundl(ji) = .true. 936 END IF 937 END DO 938 END DO 939 ! 1100 & ( zCF(ji,jkdwn+1) - zCF(ji,jkdwn) ) 1101 zldw(ji,jk) = zcff 1102 zldw(ji,jk) = ghw_abl(jk) - ghw_abl(jkdwn ) 1103 ln_foundl(ji) = .true. 1104 END IF 1105 END DO 1106 END DO 1107 ! 940 1108 END DO 941 1109 942 1110 DO jk = 1, jpka 943 DO ji = 1, jpi 944 mxl_abl( ji, jj, jk ) = MAX( SQRT( zldw( ji, jk ) * zlup( ji, jk ) ), mxl_min ) 945 END DO 946 END DO 1111 DO ji = 1, jpi 1112 !zcff = 2.*SQRT(2.)*( zldw( ji, jk )**(-2._wp/3._wp) + zlup( ji, jk )**(-2._wp/3._wp) )**(-3._wp/2._wp) 1113 zcff = SQRT( zldw( ji, jk ) * zlup( ji, jk ) ) 1114 mxlm_abl( ji, jj, jk ) = MAX( zcff, mxl_min ) 1115 mxld_abl( ji, jj, jk ) = MAX( MIN( zldw( ji, jk ), zlup( ji, jk ) ), mxl_min ) 1116 END DO 1117 END DO 947 1118 948 1119 END DO 949 # undef zlup 950 # undef zldw 951 ! 952 END SELECT 1120 # undef zlup 1121 # undef zldw 1122 ! 1123 CASE ( 3 ) ! Bougeault & Lacarrere 89 length-scale 1124 ! 1125 # define zlup zRH 1126 # define zldw zFC 1127 ! zCF is used for matrix inversion 1128 ! 1129 DO jj = 1, jpj ! outer loop 1130 ! 1131 DO jk = 2, jpkam1 1132 DO ji = 1,jpi 1133 zcff = 1.0_wp / e3w_abl( jk )**2 1134 zdU = zcff* (u_abl( ji, jj, jk+1, tind)-u_abl( ji, jj, jk , tind) )**2 1135 zdV = zcff* (v_abl( ji, jj, jk+1, tind)-v_abl( ji, jj, jk , tind) )**2 1136 zsh2(ji,jk) = SQRT(zdU+zdV) !<-- zsh2 = SQRT ( ( du/dz )^2 + ( dv/dz )^2 ) 1137 ENDDO 1138 ENDDO 1139 zsh2(:, 1) = zsh2( :, 2) 1140 zsh2(:, jpka) = zsh2( :, jpkam1) 1141 1142 DO ji = 1, jpi 1143 zcff = zrough(ji,jj) * rn_Lsfc 1144 zlup( ji, 1 ) = zcff 1145 zldw( ji, 1 ) = zcff 1146 zlup( ji, jpka ) = mxl_min 1147 zldw( ji, jpka ) = mxl_min 1148 END DO 1149 1150 DO jk = 2,jpka-1 1151 DO ji = 1, jpi 1152 zlup(ji,jk) = ghw_abl(jpka) - ghw_abl(jk) 1153 zldw(ji,jk) = ghw_abl(jk ) - ghw_abl( 1) 1154 END DO 1155 END DO 1156 !! 1157 !! BL89 search for lup 1158 !! ---------------------------------------------------------- 1159 DO jk=2,jpka-1 1160 ! 1161 DO ji = 1, jpi 1162 zCF(ji,1:jpka) = 0._wp 1163 zCF(ji, jk ) = - tke_abl( ji, jj, jk, nt_a ) 1164 ln_foundl(ji ) = .false. 1165 END DO 1166 ! 1167 DO jkup=jk+1,jpka-1 1168 DO ji = 1, jpi 1169 zbuoy1 = MAX( zbn2(ji,jj,jkup ), rsmall ) 1170 zbuoy2 = MAX( zbn2(ji,jj,jkup-1), rsmall ) 1171 zCF (ji,jkup) = zCF (ji,jkup-1) + 0.5_wp * e3t_abl(jkup) * & 1172 & ( zbuoy1*(ghw_abl(jkup )-ghw_abl(jk)) & 1173 & + zbuoy2*(ghw_abl(jkup-1)-ghw_abl(jk)) ) & 1174 & + 0.5_wp * e3t_abl(jkup) * rn_Rod * & 1175 & ( SQRT(tke_abl( ji, jj, jkup , nt_a ))*zsh2(ji,jkup ) & 1176 & + SQRT(tke_abl( ji, jj, jkup-1, nt_a ))*zsh2(ji,jkup-1) ) 1177 1178 IF( zCF (ji,jkup) * zCF (ji,jkup-1) .le. 0._wp .and. .not. ln_foundl(ji) ) THEN 1179 zcff2 = ghw_abl(jkup ) - ghw_abl(jk) 1180 zcff1 = ghw_abl(jkup-1) - ghw_abl(jk) 1181 zcff = ( zcff1 * zCF(ji,jkup) - zcff2 * zCF(ji,jkup-1) ) / & 1182 & ( zCF(ji,jkup) - zCF(ji,jkup-1) ) 1183 zlup(ji,jk) = zcff 1184 zlup(ji,jk) = ghw_abl(jkup ) - ghw_abl(jk) 1185 ln_foundl(ji) = .true. 1186 END IF 1187 END DO 1188 END DO 1189 ! 1190 END DO 1191 !! 1192 !! BL89 search for ldwn 1193 !! ---------------------------------------------------------- 1194 DO jk=2,jpka-1 1195 ! 1196 DO ji = 1, jpi 1197 zCF(ji,1:jpka) = 0._wp 1198 zCF(ji, jk ) = - tke_abl( ji, jj, jk, nt_a ) 1199 ln_foundl(ji ) = .false. 1200 END DO 1201 ! 1202 DO jkdwn=jk-1,1,-1 1203 DO ji = 1, jpi 1204 zbuoy1 = MAX( zbn2(ji,jj,jkdwn+1), rsmall ) 1205 zbuoy2 = MAX( zbn2(ji,jj,jkdwn ), rsmall ) 1206 zCF (ji,jkdwn) = zCF (ji,jkdwn+1) + 0.5_wp * e3t_abl(jkdwn+1) & 1207 & * (zbuoy1*(ghw_abl(jk)-ghw_abl(jkdwn+1)) & 1208 & +zbuoy2*(ghw_abl(jk)-ghw_abl(jkdwn )) ) & 1209 & + 0.5_wp * e3t_abl(jkup) * rn_Rod * & 1210 & ( SQRT(tke_abl( ji, jj, jkdwn+1, nt_a ))*zsh2(ji,jkdwn+1) & 1211 & + SQRT(tke_abl( ji, jj, jkdwn , nt_a ))*zsh2(ji,jkdwn ) ) 1212 1213 IF(zCF (ji,jkdwn) * zCF (ji,jkdwn+1) .le. 0._wp .and. .not. ln_foundl(ji) ) THEN 1214 zcff2 = ghw_abl(jk) - ghw_abl(jkdwn+1) 1215 zcff1 = ghw_abl(jk) - ghw_abl(jkdwn ) 1216 zcff = ( zcff1 * zCF(ji,jkdwn+1) - zcff2 * zCF(ji,jkdwn) ) / & 1217 & ( zCF(ji,jkdwn+1) - zCF(ji,jkdwn) ) 1218 zldw(ji,jk) = zcff 1219 zldw(ji,jk) = ghw_abl(jk) - ghw_abl(jkdwn ) 1220 ln_foundl(ji) = .true. 1221 END IF 1222 END DO 1223 END DO 1224 ! 1225 END DO 1226 1227 DO jk = 1, jpka 1228 DO ji = 1, jpi 1229 !zcff = 2.*SQRT(2.)*( zldw( ji, jk )**(-2._wp/3._wp) + zlup( ji, jk )**(-2._wp/3._wp) )**(-3._wp/2._wp) 1230 zcff = SQRT( zldw( ji, jk ) * zlup( ji, jk ) ) 1231 mxlm_abl( ji, jj, jk ) = MAX( zcff, mxl_min ) 1232 mxld_abl( ji, jj, jk ) = MAX( MIN( zldw( ji, jk ), zlup( ji, jk ) ), mxl_min ) 1233 END DO 1234 END DO 1235 1236 END DO 1237 # undef zlup 1238 # undef zldw 1239 ! 1240 ! 1241 END SELECT 953 1242 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 954 1243 ! ! Finalize the computation of turbulent visc./diff. 955 1244 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 956 1245 957 1246 !------------- 958 1247 DO jj = 1, jpj ! outer loop 959 1248 !------------- 960 DO jk = 1, jpka 1249 DO jk = 1, jpka 961 1250 DO ji = 1, jpi ! vector opt. 962 zcff = MAX( rn_phimax, rn_Ric * mxl_abl( ji, jj, jk ) * mxl_abl( ji, jj, jk ) &963 & * zbn2(ji, jj, jk) / tke_abl( ji, jj, jk, nt_a ) )964 zcff2 965 zcff = mxl_abl( ji, jj, jk ) * SQRT( tke_abl( ji, jj, jk, nt_a ) )966 !!FL: MAX function probably useless because of the definition of mxl_min 1251 zcff = MAX( rn_phimax, rn_Ric * mxlm_abl( ji, jj, jk ) * mxld_abl( ji, jj, jk ) & 1252 & * MAX( zbn2(ji, jj, jk), rsmall ) / tke_abl( ji, jj, jk, nt_a ) ) 1253 zcff2 = 1. / ( 1. + zcff ) !<-- phi_z(z) 1254 zcff = mxlm_abl( ji, jj, jk ) * SQRT( tke_abl( ji, jj, jk, nt_a ) ) 1255 !!FL: MAX function probably useless because of the definition of mxl_min 967 1256 Avm_abl( ji, jj, jk ) = MAX( rn_Cm * zcff , avm_bak ) 968 Avt_abl( ji, jj, jk ) = MAX( rn_Ct * zcff * zcff2 , avt_bak ) 969 END DO 970 END DO 971 !------------- 972 END DO 1257 Avt_abl( ji, jj, jk ) = MAX( rn_Ct * zcff * zcff2 , avt_bak ) 1258 END DO 1259 END DO 1260 !------------- 1261 END DO 973 1262 !------------- 974 1263 … … 988 1277 !! 989 1278 !! --------------------------------------------------------------------- 990 REAL(wp), DIMENSION(jpi,jpj), INTENT(in ) :: msk 991 1279 REAL(wp), DIMENSION(jpi,jpj), INTENT(in ) :: msk 1280 REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pvar2d 992 1281 INTEGER :: ji,jj 993 994 995 1282 REAL(wp) :: smth_a, smth_b 1283 REAL(wp), DIMENSION(jpi,jpj) :: zdX,zdY,zFX,zFY 1284 REAL(wp) :: zumsk,zvmsk 996 1285 !! 997 1286 !!========================================================= … … 1005 1294 zdX ( ji, jj ) = ( pvar2d( ji+1,jj ) - pvar2d( ji ,jj ) ) * zumsk 1006 1295 END_2D 1007 1008 1296 1297 DO_2D_10_11 1009 1298 zvmsk = msk(ji,jj) * msk(ji,jj+1) 1010 1299 zdY ( ji, jj ) = ( pvar2d( ji, jj+1 ) - pvar2d( ji ,jj ) ) * zvmsk 1011 1012 1013 1300 END_2D 1301 1302 DO_2D_10_00 1014 1303 zFY ( ji, jj ) = zdY ( ji, jj ) & 1015 1304 & + smth_a* ( (zdX ( ji, jj+1 ) - zdX( ji-1, jj+1 )) & 1016 1305 & - (zdX ( ji, jj ) - zdX( ji-1, jj )) ) 1017 1306 END_2D 1018 1307 1019 1308 DO_2D_00_10 … … 1029 1318 & +zFY( ji, jj ) - zFY( ji, jj-1 ) ) 1030 1319 END_2D 1031 !! 1320 1032 1321 !--------------------------------------------------------------------------------------------------- 1033 1322 END SUBROUTINE smooth_pblh -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/ABL/ablrst.F90
r12724 r13217 109 109 CALL iom_delay_rst( 'WRITE', 'ABL', numraw ) ! save only abl delayed global communication variables 110 110 111 ! Prognostic variables111 ! Prognostic (after timestep + swap time indices = now timestep) variables 112 112 CALL iom_rstput( iter, nitrst, numraw, 'u_abl', u_abl(:,:,:,nt_n ) ) 113 113 CALL iom_rstput( iter, nitrst, numraw, 'v_abl', v_abl(:,:,:,nt_n ) ) … … 117 117 CALL iom_rstput( iter, nitrst, numraw, 'avm_abl', avm_abl(:,:,: ) ) 118 118 CALL iom_rstput( iter, nitrst, numraw, 'avt_abl', avt_abl(:,:,: ) ) 119 CALL iom_rstput( iter, nitrst, numraw, 'mxl_abl', mxl_abl(:,:,: ) )119 CALL iom_rstput( iter, nitrst, numraw,'mxld_abl',mxld_abl(:,:,: ) ) 120 120 CALL iom_rstput( iter, nitrst, numraw, 'pblh', pblh(:,: ) ) 121 121 ! … … 172 172 CALL iom_get( numrar, jpdom_autoglo, 'avm_abl', avm_abl(:,:,: ) ) 173 173 CALL iom_get( numrar, jpdom_autoglo, 'avt_abl', avt_abl(:,:,: ) ) 174 CALL iom_get( numrar, jpdom_autoglo, 'mxl_abl', mxl_abl(:,:,: ) )174 CALL iom_get( numrar, jpdom_autoglo,'mxld_abl',mxld_abl(:,:,: ) ) 175 175 CALL iom_get( numrar, jpdom_autoglo, 'pblh', pblh(:,: ) ) 176 176 CALL iom_delay_rst( 'READ', 'ABL', numrar ) ! read only abl delayed global communication variables -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/ABL/par_abl.F90
r13193 r13217 28 28 LOGICAL , PUBLIC :: ln_hpgls_frc !: forcing of ABL winds by large-scale pressure gradient 29 29 LOGICAL , PUBLIC :: ln_smth_pblh !: smoothing of atmospheric PBL height 30 !LOGICAL , PUBLIC :: ln_topbc_neumann = .FALSE. !: idealised testcases only 30 31 31 LOGICAL , PUBLIC :: ln_rstart_abl !: (de)activate abl restart32 CHARACTER(len=256), PUBLIC :: cn_ablrst_in !: suffix of abl restart name (input)33 CHARACTER(len=256), PUBLIC :: cn_ablrst_out !: suffix of abl restart name (output)34 CHARACTER(len=256), PUBLIC :: cn_ablrst_indir !: abl restart input directory35 CHARACTER(len=256), PUBLIC :: cn_ablrst_outdir !: abl restart output directory32 LOGICAL , PUBLIC :: ln_rstart_abl !: (de)activate abl restart 33 CHARACTER(len=256), PUBLIC :: cn_ablrst_in !: suffix of abl restart name (input) 34 CHARACTER(len=256), PUBLIC :: cn_ablrst_out !: suffix of abl restart name (output) 35 CHARACTER(len=256), PUBLIC :: cn_ablrst_indir !: abl restart input directory 36 CHARACTER(len=256), PUBLIC :: cn_ablrst_outdir !: abl restart output directory 36 37 37 38 !!--------------------------------------------------------------------- … … 46 47 REAL(wp), PUBLIC, PARAMETER :: rn_Cek = 258._wp !: Ekman constant for Richardson number 47 48 REAL(wp), PUBLIC, PARAMETER :: rn_epssfc = 1._wp / ( 1._wp + 2.8_wp * 2.8_wp ) 48 REAL(wp), PUBLIC :: rn_ ceps !: namelist parameter49 REAL(wp), PUBLIC :: rn_ cm !: namelist parameter50 REAL(wp), PUBLIC :: rn_ ct !: namelist parameter51 REAL(wp), PUBLIC :: rn_ ce !: namelist parameter49 REAL(wp), PUBLIC :: rn_Ceps !: namelist parameter 50 REAL(wp), PUBLIC :: rn_Cm !: namelist parameter 51 REAL(wp), PUBLIC :: rn_Ct !: namelist parameter 52 REAL(wp), PUBLIC :: rn_Ce !: namelist parameter 52 53 REAL(wp), PUBLIC :: rn_Rod !: namelist parameter 53 54 REAL(wp), PUBLIC :: rn_Sch 55 REAL(wp), PUBLIC :: rn_Esfc 56 REAL(wp), PUBLIC :: rn_Lsfc 54 57 REAL(wp), PUBLIC :: mxl_min 55 58 REAL(wp), PUBLIC :: rn_ldyn_min !: namelist parameter -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/ABL/sbcabl.F90
r13193 r13217 71 71 & ln_hpgls_frc, ln_geos_winds, nn_dyn_restore, & 72 72 & rn_ldyn_min , rn_ldyn_max, rn_ltra_min, rn_ltra_max, & 73 & nn_amxl, rn_ cm, rn_ct, rn_ce, rn_ceps, rn_Rod, rn_Ric, &73 & nn_amxl, rn_Cm, rn_Ct, rn_Ce, rn_Ceps, rn_Rod, rn_Ric, & 74 74 & ln_smth_pblh 75 75 !!--------------------------------------------------------------------- 76 76 77 ! Namelist namsbc_abl in reference namelist : ABL parameters77 ! Namelist namsbc_abl in reference namelist : ABL parameters 78 78 READ ( numnam_ref, namsbc_abl, IOSTAT = ios, ERR = 901 ) 79 79 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_abl in reference namelist' ) 80 ! Namelist namsbc_abl in configuration namelist : ABL parameters 80 ! 81 ! Namelist namsbc_abl in configuration namelist : ABL parameters 81 82 READ ( numnam_cfg, namsbc_abl, IOSTAT = ios, ERR = 902 ) 82 83 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_abl in configuration namelist' ) … … 165 166 rn_Sch = rn_ce / rn_cm 166 167 mxl_min = (avm_bak / rn_cm) / sqrt( tke_min ) 168 rn_Esfc = 1._wp / SQRT(rn_cm*rn_ceps) 169 rn_Lsfc = vkarmn * SQRT(SQRT(rn_cm*rn_ceps)) / rn_cm 167 170 168 171 IF(lwp) THEN … … 171 174 WRITE(numout,*) ' ~~~~~~~~~~~' 172 175 IF(nn_amxl==0) WRITE(numout,*) 'Deardorff 80 length-scale ' 173 IF(nn_amxl==1) WRITE(numout,*) 'length-scale based on the distance to the PBL height ' 176 IF(nn_amxl==1) WRITE(numout,*) 'Modified Deardorff 80 length-scale ' 177 IF(nn_amxl==2) WRITE(numout,*) 'Bougeault and Lacarrere length-scale ' 178 IF(nn_amxl==3) WRITE(numout,*) 'Rodier et al. length-scale ' 174 179 WRITE(numout,*) ' Minimum value of atmospheric TKE = ',tke_min,' m^2 s^-2' 175 180 WRITE(numout,*) ' Minimum value of atmospheric mixing length = ',mxl_min,' m' … … 178 183 WRITE(numout,*) ' Constant for Schmidt number = ',rn_Sch 179 184 WRITE(numout,*) ' Constant for TKE dissipation = ',rn_Ceps 185 WRITE(numout,*) ' Constant for TKE sfc boundary condition = ',rn_Esfc 186 WRITE(numout,*) ' Constant for mxl sfc boundary condition = ',rn_Lsfc 180 187 END IF 181 188 … … 202 209 ! ABL timestep 203 210 rDt_abl = nn_fsbc * rn_Dt 211 IF(lwp) WRITE(numout,*) ' ABL timestep = ', rDt_abl,' s' 204 212 205 213 ! Check parameters for dynamics … … 248 256 zcff = 2._wp * omega * SIN( rad * 90._wp ) !++ fmax 249 257 rest_eq(:,:) = SIN( 0.5_wp*rpi*( (fft_abl(:,:) - zcff) / zcff ) )**8 250 !!GS: alternative shape251 !rest_eq(:,:) = SIN( 0.5_wp*rpi*(zcff - ABS(ff_t(:,:))) / (zcff - 3.e-5) )**8252 !WHERE(ABS(ff_t(:,:)).LE.3.e-5) rest_eq(:,:) = 1._wp253 258 ELSE 254 259 rest_eq(:,:) = 1._wp … … 271 276 CALL fld_read( nit000, nn_fsbc, sf ) ! input fields provided at the first time-step 272 277 273 u_abl(:,:,:,nt_n ) = sf(jp_wndi)%fnow(:,:,:)274 v_abl(:,:,:,nt_n ) = sf(jp_wndj)%fnow(:,:,:)278 u_abl(:,:,:,nt_n ) = sf(jp_wndi)%fnow(:,:,:) 279 v_abl(:,:,:,nt_n ) = sf(jp_wndj)%fnow(:,:,:) 275 280 tq_abl(:,:,:,nt_n,jp_ta) = sf(jp_tair)%fnow(:,:,:) 276 281 tq_abl(:,:,:,nt_n,jp_qa) = sf(jp_humi)%fnow(:,:,:) … … 279 284 avm_abl(:,:,: ) = avm_bak 280 285 avt_abl(:,:,: ) = avt_bak 281 mxl_abl(:,:,: ) = mxl_min282 286 pblh (:,: ) = ghw_abl( 3 ) !<-- assume that the pbl contains 3 grid points 283 287 u_abl (:,:,:,nt_a ) = 0._wp … … 285 289 tq_abl (:,:,:,nt_a,: ) = 0._wp 286 290 tke_abl(:,:,:,nt_a ) = 0._wp 291 292 mxlm_abl(:,:,: ) = mxl_min 293 mxld_abl(:,:,: ) = mxl_min 287 294 ENDIF 288 295 … … 335 342 & tq_abl(:,:,2,nt_n,jp_ta), tq_abl(:,:,2,nt_n,jp_qa), & ! <<= in 336 343 & sf(jp_slp )%fnow(:,:,1) , sst_m, ssu_m, ssv_m , & ! <<= in 344 & sf(jp_uoatm)%fnow(:,:,1), sf(jp_voatm)%fnow(:,:,1), & ! <<= in 337 345 & sf(jp_qsr )%fnow(:,:,1) , sf(jp_qlw )%fnow(:,:,1) , & ! <<= in 338 346 & tsk_m, zssq, zcd_du, zsen, zevp ) ! =>> out -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/IOM/iom.F90
r12724 r13217 1193 1193 & 'we accept this case, even if there is a possible mix-up between z and time dimension' ) 1194 1194 idmspc = idmspc - 1 1195 ELSE 1196 CALL ctl_stop( TRIM(clinfo), 'To keep iom lisibility, when reading a '//clrankpv//'D array,' , & 1197 & 'we do not accept data with '//cldmspc//' spatial dimensions', & 1198 & 'Use ncwa -a to suppress the unnecessary dimensions' ) 1195 !!GS: possibility to read 3D ABL atmopsheric forcing and use 1st level to force BULK simulation 1196 !ELSE 1197 ! CALL ctl_stop( TRIM(clinfo), 'To keep iom lisibility, when reading a '//clrankpv//'D array,', & 1198 ! & 'we do not accept data with '//cldmspc//' spatial dimensions' , & 1199 ! & 'Use ncwa -a to suppress the unnecessary dimensions' ) 1199 1200 ENDIF 1200 1201 ENDIF -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/SBC/sbcblk.F90
r13193 r13217 74 74 #endif 75 75 76 INTEGER , PUBLIC :: jpfld ! maximum number of files to read 77 INTEGER , PUBLIC, PARAMETER :: jp_wndi = 1 ! index of 10m wind velocity (i-component) (m/s) at T-point 78 INTEGER , PUBLIC, PARAMETER :: jp_wndj = 2 ! index of 10m wind velocity (j-component) (m/s) at T-point 79 INTEGER , PUBLIC, PARAMETER :: jp_tair = 3 ! index of 10m air temperature (Kelvin) 80 INTEGER , PUBLIC, PARAMETER :: jp_humi = 4 ! index of specific humidity ( % ) 81 INTEGER , PUBLIC, PARAMETER :: jp_qsr = 5 ! index of solar heat (W/m2) 82 INTEGER , PUBLIC, PARAMETER :: jp_qlw = 6 ! index of Long wave (W/m2) 83 INTEGER , PUBLIC, PARAMETER :: jp_prec = 7 ! index of total precipitation (rain+snow) (Kg/m2/s) 84 INTEGER , PUBLIC, PARAMETER :: jp_snow = 8 ! index of snow (solid prcipitation) (kg/m2/s) 85 INTEGER , PUBLIC, PARAMETER :: jp_slp = 9 ! index of sea level pressure (Pa) 86 INTEGER , PUBLIC, PARAMETER :: jp_hpgi =10 ! index of ABL geostrophic wind or hpg (i-component) (m/s) at T-point 87 INTEGER , PUBLIC, PARAMETER :: jp_hpgj =11 ! index of ABL geostrophic wind or hpg (j-component) (m/s) at T-point 88 76 INTEGER , PUBLIC, PARAMETER :: jp_wndi = 1 ! index of 10m wind velocity (i-component) (m/s) at T-point 77 INTEGER , PUBLIC, PARAMETER :: jp_wndj = 2 ! index of 10m wind velocity (j-component) (m/s) at T-point 78 INTEGER , PUBLIC, PARAMETER :: jp_tair = 3 ! index of 10m air temperature (Kelvin) 79 INTEGER , PUBLIC, PARAMETER :: jp_humi = 4 ! index of specific humidity ( % ) 80 INTEGER , PUBLIC, PARAMETER :: jp_qsr = 5 ! index of solar heat (W/m2) 81 INTEGER , PUBLIC, PARAMETER :: jp_qlw = 6 ! index of Long wave (W/m2) 82 INTEGER , PUBLIC, PARAMETER :: jp_prec = 7 ! index of total precipitation (rain+snow) (Kg/m2/s) 83 INTEGER , PUBLIC, PARAMETER :: jp_snow = 8 ! index of snow (solid prcipitation) (kg/m2/s) 84 INTEGER , PUBLIC, PARAMETER :: jp_slp = 9 ! index of sea level pressure (Pa) 85 INTEGER , PUBLIC, PARAMETER :: jp_uoatm = 10 ! index of surface current (i-component) 86 ! ! seen by the atmospheric forcing (m/s) at T-point 87 INTEGER , PUBLIC, PARAMETER :: jp_voatm = 11 ! index of surface current (j-component) 88 ! ! seen by the atmospheric forcing (m/s) at T-point 89 INTEGER , PUBLIC, PARAMETER :: jp_hpgi = 12 ! index of ABL geostrophic wind or hpg (i-component) (m/s) at T-point 90 INTEGER , PUBLIC, PARAMETER :: jp_hpgj = 13 ! index of ABL geostrophic wind or hpg (j-component) (m/s) at T-point 91 INTEGER , PUBLIC, PARAMETER :: jpfld = 13 ! maximum number of files to read 92 93 ! Warning: keep this structure allocatable for Agrif... 89 94 TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:) :: sf ! structure of input atmospheric fields (file informations, fields read) 90 95 … … 98 103 LOGICAL :: ln_Cd_L15 ! ice-atm drag = F( ice concentration, atmospheric stability ) (Lupkes et al. JGR2015) 99 104 ! 105 LOGICAL :: ln_crt_fbk ! Add surface current feedback to the wind stress computation (Renault et al. 2020) 106 REAL(wp) :: rn_stau_a ! Alpha and Beta coefficients of Renault et al. 2020, eq. 10: Stau = Alpha * Wnd + Beta 107 REAL(wp) :: rn_stau_b ! 108 ! 100 109 REAL(wp) :: rn_pfac ! multiplication factor for precipitation 101 110 REAL(wp), PUBLIC :: rn_efac ! multiplication factor for evaporation 102 REAL(wp), PUBLIC :: rn_vfac ! multiplication factor for ice/ocean velocity in the calculation of wind stress103 111 REAL(wp) :: rn_zqt ! z(q,t) : height of humidity and temperature measurements 104 112 REAL(wp) :: rn_zu ! z(u) : height of wind measurements 105 113 ! 106 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: Cd_ice , Ch_ice , Ce_ice ! transfert coefficients over ice107 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: Cdn_oce, Chn_oce, Cen_oce ! neutral coeffs over ocean (L15 bulk scheme)108 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: t_zu, q_zu ! air temp. and spec. hum. at wind speed height (L15 bulk scheme)114 REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: Cdn_oce, Chn_oce, Cen_oce ! neutral coeffs over ocean (L15 bulk scheme and ABL) 115 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: Cd_ice , Ch_ice , Ce_ice ! transfert coefficients over ice 116 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: t_zu, q_zu ! air temp. and spec. hum. at wind speed height (L15 bulk scheme) 109 117 110 118 LOGICAL :: ln_skin_cs ! use the cool-skin (only available in ECMWF and COARE algorithms) !LB … … 113 121 LOGICAL :: ln_humi_dpt ! humidity read in files ("sn_humi") is dew-point temperature [K] if .true. !LB 114 122 LOGICAL :: ln_humi_rlh ! humidity read in files ("sn_humi") is relative humidity [%] if .true. !LB 123 LOGICAL :: ln_tpot !!GS: flag to compute or not potential temperature 115 124 ! 116 125 INTEGER :: nhumi ! choice of the bulk algorithm … … 162 171 !! 163 172 CHARACTER(len=100) :: cn_dir ! Root directory for location of atmospheric forcing files 164 TYPE(FLD_N), ALLOCATABLE, DIMENSION(:) :: slf_i ! array of namelist informations on the fields to read 165 TYPE(FLD_N) :: sn_wndi, sn_wndj, sn_humi, sn_qsr ! informations about the fields to be read 166 TYPE(FLD_N) :: sn_qlw , sn_tair, sn_prec, sn_snow ! " " 167 TYPE(FLD_N) :: sn_slp , sn_hpgi, sn_hpgj ! " " 173 TYPE(FLD_N), DIMENSION(jpfld) :: slf_i ! array of namelist informations on the fields to read 174 TYPE(FLD_N) :: sn_wndi, sn_wndj , sn_humi, sn_qsr ! informations about the fields to be read 175 TYPE(FLD_N) :: sn_qlw , sn_tair , sn_prec, sn_snow ! " " 176 TYPE(FLD_N) :: sn_slp , sn_uoatm, sn_voatm ! " " 177 TYPE(FLD_N) :: sn_hpgi, sn_hpgj ! " " 178 INTEGER :: ipka ! number of levels in the atmospheric variable 168 179 NAMELIST/namsbc_blk/ sn_wndi, sn_wndj, sn_humi, sn_qsr, sn_qlw , & ! input fields 169 & sn_tair, sn_prec, sn_snow, sn_slp, sn_hpgi, sn_hpgj, & 180 & sn_tair, sn_prec, sn_snow, sn_slp, sn_uoatm, sn_voatm, & 181 & sn_hpgi, sn_hpgj, & 170 182 & ln_NCAR, ln_COARE_3p0, ln_COARE_3p6, ln_ECMWF, & ! bulk algorithm 171 183 & cn_dir , rn_zqt, rn_zu, & 172 & rn_pfac, rn_efac, rn_vfac, ln_Cd_L12, ln_Cd_L15, & 184 & rn_pfac, rn_efac, ln_Cd_L12, ln_Cd_L15, ln_tpot, & 185 & ln_crt_fbk, rn_stau_a, rn_stau_b, & ! current feedback 173 186 & ln_skin_cs, ln_skin_wl, ln_humi_sph, ln_humi_dpt, ln_humi_rlh ! cool-skin / warm-layer !LB 174 187 !!--------------------------------------------------------------------- … … 242 255 ! !* set the bulk structure 243 256 ! !- store namelist information in an array 244 IF( ln_blk ) jpfld = 9 245 IF( ln_abl ) jpfld = 11 246 ALLOCATE( slf_i(jpfld) ) 247 ! 248 slf_i(jp_wndi) = sn_wndi ; slf_i(jp_wndj) = sn_wndj 249 slf_i(jp_qsr ) = sn_qsr ; slf_i(jp_qlw ) = sn_qlw 250 slf_i(jp_tair) = sn_tair ; slf_i(jp_humi) = sn_humi 251 slf_i(jp_prec) = sn_prec ; slf_i(jp_snow) = sn_snow 252 slf_i(jp_slp ) = sn_slp 253 IF( ln_abl ) THEN 254 slf_i(jp_hpgi) = sn_hpgi ; slf_i(jp_hpgj) = sn_hpgj 255 END IF 257 ! 258 slf_i(jp_wndi ) = sn_wndi ; slf_i(jp_wndj ) = sn_wndj 259 slf_i(jp_qsr ) = sn_qsr ; slf_i(jp_qlw ) = sn_qlw 260 slf_i(jp_tair ) = sn_tair ; slf_i(jp_humi ) = sn_humi 261 slf_i(jp_prec ) = sn_prec ; slf_i(jp_snow ) = sn_snow 262 slf_i(jp_slp ) = sn_slp 263 slf_i(jp_uoatm) = sn_uoatm ; slf_i(jp_voatm) = sn_voatm 264 slf_i(jp_hpgi ) = sn_hpgi ; slf_i(jp_hpgj ) = sn_hpgj 265 ! 266 IF( .NOT. ln_abl ) THEN ! force to not use jp_hpgi and jp_hpgj, should already be done in namelist_* but we never know... 267 slf_i(jp_hpgi)%clname = 'NOT USED' 268 slf_i(jp_hpgj)%clname = 'NOT USED' 269 ENDIF 256 270 ! 257 271 ! !- allocate the bulk structure … … 264 278 DO jfpr= 1, jpfld 265 279 ! 266 IF( TRIM(sf(jfpr)%clrootname) == 'NOT USED' ) THEN !-- not used field --! (only now allocated and set to zero) 267 ALLOCATE( sf(jfpr)%fnow(jpi,jpj,1) ) 268 sf(jfpr)%fnow(:,:,1) = 0._wp 280 IF( ln_abl .AND. & 281 & ( jfpr == jp_wndi .OR. jfpr == jp_wndj .OR. jfpr == jp_humi .OR. & 282 & jfpr == jp_hpgi .OR. jfpr == jp_hpgj .OR. jfpr == jp_tair ) ) THEN 283 ipka = jpka ! ABL: some fields are 3D input 284 ELSE 285 ipka = 1 286 ENDIF 287 ! 288 ALLOCATE( sf(jfpr)%fnow(jpi,jpj,ipka) ) 289 ! 290 IF( TRIM(sf(jfpr)%clrootname) == 'NOT USED' ) THEN !-- not used field --! (only now allocated and set to default) 291 IF( jfpr == jp_slp ) THEN 292 sf(jfpr)%fnow(:,:,1:ipka) = 101325._wp ! use standard pressure in Pa 293 ELSEIF( jfpr == jp_prec .OR. jfpr == jp_snow .OR. jfpr == jp_uoatm .OR. jfpr == jp_voatm ) THEN 294 sf(jfpr)%fnow(:,:,1:ipka) = 0._wp ! no precip or no snow or no surface currents 295 ELSEIF( ( jfpr == jp_hpgi .OR. jfpr == jp_hpgj ) .AND. .NOT. ln_abl ) THEN 296 DEALLOCATE( sf(jfpr)%fnow ) ! deallocate as not used in this case 297 ELSE 298 WRITE(ctmp1,*) 'sbc_blk_init: no default value defined for field number', jfpr 299 CALL ctl_stop( ctmp1 ) 300 ENDIF 269 301 ELSE !-- used field --! 270 IF( ln_abl .AND. & 271 & ( jfpr == jp_wndi .OR. jfpr == jp_wndj .OR. jfpr == jp_humi .OR. & 272 & jfpr == jp_hpgi .OR. jfpr == jp_hpgj .OR. jfpr == jp_tair ) ) THEN ! ABL: some fields are 3D input 273 ALLOCATE( sf(jfpr)%fnow(jpi,jpj,jpka) ) 274 IF( sf(jfpr)%ln_tint ) ALLOCATE( sf(jfpr)%fdta(jpi,jpj,jpka,2) ) 275 ELSE ! others or Bulk fields are 2D fiels 276 ALLOCATE( sf(jfpr)%fnow(jpi,jpj,1) ) 277 IF( sf(jfpr)%ln_tint ) ALLOCATE( sf(jfpr)%fdta(jpi,jpj,1,2) ) 278 ENDIF 302 IF( sf(jfpr)%ln_tint ) ALLOCATE( sf(jfpr)%fdta(jpi,jpj,ipka,2) ) ! allocate array for temporal interpolation 279 303 ! 280 304 IF( sf(jfpr)%freqh > 0. .AND. MOD( NINT(3600. * sf(jfpr)%freqh), nn_fsbc * NINT(rn_Dt) ) /= 0 ) & … … 327 351 WRITE(numout,*) ' factor applied on precipitation (total & snow) rn_pfac = ', rn_pfac 328 352 WRITE(numout,*) ' factor applied on evaporation rn_efac = ', rn_efac 329 WRITE(numout,*) ' factor applied on ocean/ice velocity rn_vfac = ', rn_vfac330 353 WRITE(numout,*) ' (form absolute (=0) to relative winds(=1))' 331 354 WRITE(numout,*) ' use ice-atm drag from Lupkes2012 ln_Cd_L12 = ', ln_Cd_L12 332 355 WRITE(numout,*) ' use ice-atm drag from Lupkes2015 ln_Cd_L15 = ', ln_Cd_L15 356 WRITE(numout,*) ' use surface current feedback on wind stress ln_crt_fbk = ', ln_crt_fbk 357 IF(ln_crt_fbk) THEN 358 WRITE(numout,*) ' Renault et al. 2020, eq. 10: Stau = Alpha * Wnd + Beta' 359 WRITE(numout,*) ' Alpha rn_stau_a = ', rn_stau_a 360 WRITE(numout,*) ' Beta rn_stau_b = ', rn_stau_b 361 ENDIF 333 362 ! 334 363 WRITE(numout,*) … … 429 458 ! ! compute the surface ocean fluxes using bulk formulea 430 459 IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN 431 CALL blk_oce_1( kt, sf(jp_wndi)%fnow(:,:,1), sf(jp_wndj)%fnow(:,:,1), & ! <<= in 432 & sf(jp_tair)%fnow(:,:,1), sf(jp_humi)%fnow(:,:,1), & ! <<= in 433 & sf(jp_slp )%fnow(:,:,1), sst_m, ssu_m, ssv_m, & ! <<= in 434 & sf(jp_qsr )%fnow(:,:,1), sf(jp_qlw )%fnow(:,:,1), & ! <<= in (wl/cs) 435 & tsk_m, zssq, zcd_du, zsen, zevp ) ! =>> out 436 437 CALL blk_oce_2( sf(jp_tair)%fnow(:,:,1), sf(jp_qsr )%fnow(:,:,1), & ! <<= in 438 & sf(jp_qlw )%fnow(:,:,1), sf(jp_prec)%fnow(:,:,1), & ! <<= in 439 & sf(jp_snow)%fnow(:,:,1), tsk_m, & ! <<= in 440 & zsen, zevp ) ! <=> in out 460 CALL blk_oce_1( kt, sf(jp_wndi )%fnow(:,:,1), sf(jp_wndj )%fnow(:,:,1), & ! <<= in 461 & sf(jp_tair )%fnow(:,:,1), sf(jp_humi )%fnow(:,:,1), & ! <<= in 462 & sf(jp_slp )%fnow(:,:,1), sst_m, ssu_m, ssv_m, & ! <<= in 463 & sf(jp_uoatm)%fnow(:,:,1), sf(jp_voatm)%fnow(:,:,1), & ! <<= in 464 & sf(jp_qsr )%fnow(:,:,1), sf(jp_qlw )%fnow(:,:,1), & ! <<= in (wl/cs) 465 & tsk_m, zssq, zcd_du, zsen, zevp ) ! =>> out 466 467 CALL blk_oce_2( sf(jp_tair )%fnow(:,:,1), sf(jp_qsr )%fnow(:,:,1), & ! <<= in 468 & sf(jp_qlw )%fnow(:,:,1), sf(jp_prec )%fnow(:,:,1), & ! <<= in 469 & sf(jp_snow )%fnow(:,:,1), tsk_m, & ! <<= in 470 & zsen, zevp ) ! <=> in out 441 471 ENDIF 442 472 ! … … 470 500 471 501 472 SUBROUTINE blk_oce_1( kt, pwndi, pwndj , ptair, phumi,& ! inp473 & pslp , pst , pu , pv,& ! inp474 & pqsr , pqlw ,& ! inp475 & ptsk, pssq , pcd_du, psen , pevp )! out502 SUBROUTINE blk_oce_1( kt, pwndi, pwndj, ptair, phumi, & ! inp 503 & pslp , pst , pu , pv, & ! inp 504 & puatm, pvatm, pqsr , pqlw , & ! inp 505 & ptsk , pssq , pcd_du, psen, pevp ) ! out 476 506 !!--------------------------------------------------------------------- 477 507 !! *** ROUTINE blk_oce_1 *** … … 498 528 REAL(wp), INTENT(in ), DIMENSION(:,:) :: pu ! surface current at U-point (i-component) [m/s] 499 529 REAL(wp), INTENT(in ), DIMENSION(:,:) :: pv ! surface current at V-point (j-component) [m/s] 530 REAL(wp), INTENT(in ), DIMENSION(:,:) :: puatm ! surface current seen by the atm at T-point (i-component) [m/s] 531 REAL(wp), INTENT(in ), DIMENSION(:,:) :: pvatm ! surface current seen by the atm at T-point (j-component) [m/s] 500 532 REAL(wp), INTENT(in ), DIMENSION(:,:) :: pqsr ! 501 533 REAL(wp), INTENT(in ), DIMENSION(:,:) :: pqlw ! … … 508 540 INTEGER :: ji, jj ! dummy loop indices 509 541 REAL(wp) :: zztmp ! local variable 542 REAL(wp) :: zstmax, zstau 543 #if defined key_cyclone 510 544 REAL(wp), DIMENSION(jpi,jpj) :: zwnd_i, zwnd_j ! wind speed components at T-point 545 #endif 546 REAL(wp), DIMENSION(jpi,jpj) :: ztau_i, ztau_j ! wind stress components at T-point 511 547 REAL(wp), DIMENSION(jpi,jpj) :: zU_zu ! bulk wind speed at height zu [m/s] 512 548 REAL(wp), DIMENSION(jpi,jpj) :: ztpot ! potential temperature of air at z=rn_zqt [K] … … 532 568 zwnd_j(:,:) = 0._wp 533 569 CALL wnd_cyc( kt, zwnd_i, zwnd_j ) ! add analytical tropical cyclone (Vincent et al. JGR 2012) 534 DO_2D_00_00 535 pwndi(ji,jj) = pwndi(ji,jj) + zwnd_i(ji,jj) 536 pwndj(ji,jj) = pwndj(ji,jj) + zwnd_j(ji,jj) 570 DO_2D_11_11 571 zwnd_i(ji,jj) = pwndi(ji,jj) + zwnd_i(ji,jj) 572 zwnd_j(ji,jj) = pwndj(ji,jj) + zwnd_j(ji,jj) 573 ! ... scalar wind at T-point (not masked) 574 wndm(ji,jj) = SQRT( zwnd_i(ji,jj) * zwnd_i(ji,jj) + zwnd_j(ji,jj) * zwnd_j(ji,jj) ) 575 END_2D 576 #else 577 ! ... scalar wind module at T-point (not masked) 578 DO_2D_11_11 579 wndm(ji,jj) = SQRT( pwndi(ji,jj) * pwndi(ji,jj) + pwndj(ji,jj) * pwndj(ji,jj) ) 537 580 END_2D 538 581 #endif 539 DO_2D_00_00540 zwnd_i(ji,jj) = ( pwndi(ji,jj) - rn_vfac * 0.5 * ( pu(ji-1,jj ) + pu(ji,jj) ) )541 zwnd_j(ji,jj) = ( pwndj(ji,jj) - rn_vfac * 0.5 * ( pv(ji ,jj-1) + pv(ji,jj) ) )542 END_2D543 CALL lbc_lnk_multi( 'sbcblk', zwnd_i, 'T', -1., zwnd_j, 'T', -1. )544 ! ... scalar wind ( = | U10m - U_oce | ) at T-point (masked)545 wndm(:,:) = SQRT( zwnd_i(:,:) * zwnd_i(:,:) &546 & + zwnd_j(:,:) * zwnd_j(:,:) ) * tmask(:,:,1)547 548 582 ! ----------------------------------------------------------------------------- ! 549 583 ! I Solar FLUX ! … … 593 627 !#LB: because AGRIF hates functions that return something else than a scalar, need to 594 628 ! use scalar version of gamma_moist() ... 595 DO_2D_11_11 596 ztpot(ji,jj) = ptair(ji,jj) + gamma_moist( ptair(ji,jj), zqair(ji,jj) ) * rn_zqt 597 END_2D 598 ENDIF 599 600 629 IF( ln_tpot ) THEN 630 DO_2D_11_11 631 ztpot(ji,jj) = ptair(ji,jj) + gamma_moist( ptair(ji,jj), zqair(ji,jj) ) * rn_zqt 632 END_2D 633 ELSE 634 ztpot = ptair(:,:) 635 ENDIF 636 ENDIF 601 637 602 638 !! Time to call the user-selected bulk parameterization for … … 674 710 pevp(:,:) = pevp(:,:) * tmask(:,:,1) 675 711 676 ! Tau i and j component on T-grid points, using array "zcd_oce" as a temporary array... 677 zcd_oce = 0._wp 678 WHERE ( wndm > 0._wp ) zcd_oce = taum / wndm 679 zwnd_i = zcd_oce * zwnd_i 680 zwnd_j = zcd_oce * zwnd_j 681 682 CALL iom_put( "taum_oce", taum ) ! output wind stress module 712 DO_2D_11_11 713 IF( wndm(ji,jj) > 0._wp ) THEN 714 zztmp = taum(ji,jj) / wndm(ji,jj) 715 #if defined key_cyclone 716 ztau_i(ji,jj) = zztmp * zwnd_i(ji,jj) 717 ztau_j(ji,jj) = zztmp * zwnd_j(ji,jj) 718 #else 719 ztau_i(ji,jj) = zztmp * pwndi(ji,jj) 720 ztau_j(ji,jj) = zztmp * pwndj(ji,jj) 721 #endif 722 ELSE 723 ztau_i(ji,jj) = 0._wp 724 ztau_j(ji,jj) = 0._wp 725 ENDIF 726 END_2D 727 728 IF( ln_crt_fbk ) THEN ! aply eq. 10 and 11 of Renault et al. 2020 (doi: 10.1029/2019MS001715) 729 zstmax = MIN( rn_stau_a * 3._wp + rn_stau_b, 0._wp ) ! set the max value of Stau corresponding to a wind of 3 m/s (<0) 730 DO_2D_01_01 ! end at jpj and jpi, as ztau_j(ji,jj+1) ztau_i(ji+1,jj) used in the next loop 731 zstau = MIN( rn_stau_a * wndm(ji,jj) + rn_stau_b, zstmax ) ! stau (<0) must be smaller than zstmax 732 ztau_i(ji,jj) = ztau_i(ji,jj) + zstau * ( 0.5_wp * ( pu(ji-1,jj ) + pu(ji,jj) ) - puatm(ji,jj) ) 733 ztau_j(ji,jj) = ztau_j(ji,jj) + zstau * ( 0.5_wp * ( pv(ji ,jj-1) + pv(ji,jj) ) - pvatm(ji,jj) ) 734 taum(ji,jj) = SQRT( ztau_i(ji,jj) * ztau_i(ji,jj) + ztau_j(ji,jj) * ztau_j(ji,jj) ) 735 END_2D 736 ENDIF 683 737 684 738 ! ... utau, vtau at U- and V_points, resp. 685 739 ! Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines 686 740 ! Note that coastal wind stress is not used in the code... so this extra care has no effect 687 DO_2D_00_00 688 utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( z wnd_i(ji,jj) + zwnd_i(ji+1,jj ) ) &689 & * MAX(tmask(ji,jj,1),tmask(ji+1,jj,1))690 vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( z wnd_j(ji,jj) + zwnd_j(ji ,jj+1) ) &691 & * MAX(tmask(ji,jj,1),tmask(ji,jj+1,1))741 DO_2D_00_00 ! start loop at 2, in case ln_crt_fbk = T 742 utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( ztau_i(ji,jj) + ztau_i(ji+1,jj ) ) & 743 & * MAX(tmask(ji,jj,1),tmask(ji+1,jj,1)) 744 vtau(ji,jj) = 0.5 * ( 2. - vmask(ji,jj,1) ) * ( ztau_j(ji,jj) + ztau_j(ji ,jj+1) ) & 745 & * MAX(tmask(ji,jj,1),tmask(ji,jj+1,1)) 692 746 END_2D 693 CALL lbc_lnk_multi( 'sbcblk', utau, 'U', -1., vtau, 'V', -1. ) 747 748 IF( ln_crt_fbk ) THEN 749 CALL lbc_lnk_multi( 'sbcblk', utau, 'U', -1., vtau, 'V', -1., taum, 'T', -1. ) 750 ELSE 751 CALL lbc_lnk_multi( 'sbcblk', utau, 'U', -1., vtau, 'V', -1. ) 752 ENDIF 753 754 CALL iom_put( "taum_oce", taum ) ! output wind stress module 694 755 695 756 IF(sn_cfctl%l_prtctl) THEN … … 862 923 ! 863 924 INTEGER :: ji, jj ! dummy loop indices 864 REAL(wp) :: zwndi_t , zwndj_t ! relative wind components at T-point865 925 REAL(wp) :: zootm_su ! sea-ice surface mean temperature 866 926 REAL(wp) :: zztmp1, zztmp2 ! temporary arrays … … 873 933 ! ------------------------------------------------------------ ! 874 934 ! C-grid ice dynamics : U & V-points (same as ocean) 875 DO_2D_00_00 876 zwndi_t = ( pwndi(ji,jj) - rn_vfac * 0.5_wp * ( puice(ji-1,jj ) + puice(ji,jj) ) ) 877 zwndj_t = ( pwndj(ji,jj) - rn_vfac * 0.5_wp * ( pvice(ji ,jj-1) + pvice(ji,jj) ) ) 878 wndm_ice(ji,jj) = SQRT( zwndi_t * zwndi_t + zwndj_t * zwndj_t ) * tmask(ji,jj,1) 935 DO_2D_11_11 936 wndm_ice(ji,jj) = SQRT( pwndi(ji,jj) * pwndi(ji,jj) + pwndj(ji,jj) * pwndj(ji,jj) ) 879 937 END_2D 880 CALL lbc_lnk( 'sbcblk', wndm_ice, 'T', 1. )881 938 ! 882 939 ! Make ice-atm. drag dependent on ice concentration … … 898 955 899 956 IF( ln_blk ) THEN 900 ! ---------------------------------------------------- ---------!901 ! Wind stress relative to the moving ice ( U10m - U_ice) !902 ! ---------------------------------------------------- ---------!903 zztmp1 = rn_vfac * 0.5_wp957 ! ---------------------------------------------------- ! 958 ! Wind stress relative to nonmoving ice ( U10m ) ! 959 ! ---------------------------------------------------- ! 960 ! supress moving ice in wind stress computation as we don't know how to do it properly... 904 961 DO_2D_01_01 ! at T point 905 putaui(ji,jj) = rhoa(ji,jj) * zcd_dui(ji,jj) * ( pwndi(ji,jj) - zztmp1 * ( puice(ji-1,jj ) + puice(ji,jj) ))906 pvtaui(ji,jj) = rhoa(ji,jj) * zcd_dui(ji,jj) * ( pwndj(ji,jj) - zztmp1 * ( pvice(ji ,jj-1) + pvice(ji,jj) ))962 putaui(ji,jj) = rhoa(ji,jj) * zcd_dui(ji,jj) * pwndi(ji,jj) 963 pvtaui(ji,jj) = rhoa(ji,jj) * zcd_dui(ji,jj) * pwndj(ji,jj) 907 964 END_2D 908 965 ! … … 918 975 IF(sn_cfctl%l_prtctl) CALL prt_ctl( tab2d_1=putaui , clinfo1=' blk_ice: putaui : ' & 919 976 & , tab2d_2=pvtaui , clinfo2=' pvtaui : ' ) 920 ELSE 977 ELSE ! ln_abl 921 978 zztmp1 = 11637800.0_wp 922 979 zztmp2 = -5897.8_wp -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/SBC/sbcblk_phy.F90
r13193 r13217 640 640 !! *** FUNCTION alpha_sw_vctr *** 641 641 !! 642 !! ** Purpose : ROUGH estimate of the thermal expansion coefficient of sea-water at the surface ( P =~ 1010 hpa)642 !! ** Purpose : ROUGH estimate of the thermal expansion coefficient of sea-water at the surface (i.e. P =~ 101000 Pa) 643 643 !! 644 644 !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/) … … 654 654 !! *** FUNCTION alpha_sw_sclr *** 655 655 !! 656 !! ** Purpose : ROUGH estimate of the thermal expansion coefficient of sea-water at the surface ( P =~ 1010 hpa)656 !! ** Purpose : ROUGH estimate of the thermal expansion coefficient of sea-water at the surface (i.e. P =~ 101000 Pa) 657 657 !! 658 658 !! ** Author: L. Brodeau, june 2016 / AeroBulk (https://github.com/brodeau/aerobulk/) -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/src/OCE/TRA/traqsr.F90
r12724 r13217 111 111 REAL(wp) :: zc0 , zc1 , zc2 , zc3 ! - - 112 112 REAL(wp) :: zzc0, zzc1, zzc2, zzc3 ! - - 113 REAL(wp) :: zz0 , zz1 ! - - 114 REAL(wp) :: zCb, zCmax, zze, zpsi, zpsimax, zdelpsi, zCtot, zCze 115 REAL(wp) :: zlogc, zlogc2, zlogc3 116 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zekb, zekg, zekr 117 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ze0, ze1, ze2, ze3, zea, ztrdt 118 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zetot, zchl3d 113 REAL(wp) :: zz0 , zz1 , ze3t, zlui ! - - 114 REAL(wp) :: zCb, zCmax, zpsi, zpsimax, zrdpsi, zCze 115 REAL(wp) :: zlogc, zlogze, zlogCtot, zlogCze 116 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: ze0, ze1, ze2, ze3 117 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdt, zetot, ztmp3d 119 118 !!---------------------------------------------------------------------- 120 119 ! … … 161 160 CASE( np_RGB , np_RGBc ) !== R-G-B fluxes ==! 162 161 ! 163 ALLOCATE( ze kb(jpi,jpj) , zekg(jpi,jpj) , zekr (jpi,jpj) ,&164 & ze 0 (jpi,jpj,jpk) , ze1 (jpi,jpj,jpk) , ze2 (jpi,jpj,jpk) ,&165 & z e3 (jpi,jpj,jpk) , zea (jpi,jpj,jpk) , zchl3d(jpi,jpj,jpk))162 ALLOCATE( ze0 (jpi,jpj) , ze1 (jpi,jpj) , & 163 & ze2 (jpi,jpj) , ze3 (jpi,jpj) , & 164 & ztmp3d(jpi,jpj,nksr + 1) ) 166 165 ! 167 166 IF( nqsr == np_RGBc ) THEN !* Variable Chlorophyll 168 167 CALL fld_read( kt, 1, sf_chl ) ! Read Chl data and provides it at the current time step 168 ! 169 ! Separation in R-G-B depending on the surface Chl 170 ! perform and store as many of the 2D calculations as possible 171 ! before the 3D loop (use the temporary 2D arrays to replace the 172 ! most expensive calculations) 173 ! 174 DO_2D_00_00 175 ! zlogc = log(zchl) 176 zlogc = LOG ( MIN( 10. , MAX( 0.03, sf_chl(1)%fnow(ji,jj,1) ) ) ) 177 ! zc1 : log(zCze) = log (1.12 * zchl**0.803) 178 zc1 = 0.113328685307 + 0.803 * zlogc 179 ! zc2 : log(zCtot) = log(40.6 * zchl**0.459) 180 zc2 = 3.703768066608 + 0.459 * zlogc 181 ! zc3 : log(zze) = log(568.2 * zCtot**(-0.746)) 182 zc3 = 6.34247346942 - 0.746 * zc2 183 ! IF( log(zze) > log(102.) ) log(zze) = log(200.0 * zCtot**(-0.293)) 184 IF( zc3 > 4.62497281328 ) zc3 = 5.298317366548 - 0.293 * zc2 185 ! 186 ze0(ji,jj) = zlogc ! ze0 = log(zchl) 187 ze1(ji,jj) = EXP( zc1 ) ! ze1 = zCze 188 ze2(ji,jj) = 1._wp / ( 0.710 + zlogc * ( 0.159 + zlogc * 0.021 ) ) ! ze2 = 1/zdelpsi 189 ze3(ji,jj) = EXP( - zc3 ) ! ze3 = 1/zze 190 END_2D 191 192 ! 193 DO_3D_00_00 ( 1, nksr + 1 ) 194 ! zchl = ALOG( ze0(ji,jj) ) 195 zlogc = ze0(ji,jj) 196 ! 197 zCb = 0.768 + zlogc * ( 0.087 - zlogc * ( 0.179 + zlogc * 0.025 ) ) 198 zCmax = 0.299 - zlogc * ( 0.289 - zlogc * 0.579 ) 199 zpsimax = 0.6 - zlogc * ( 0.640 - zlogc * ( 0.021 + zlogc * 0.115 ) ) 200 ! zdelpsi = 0.710 + zlogc * ( 0.159 + zlogc * 0.021 ) 201 ! 202 zCze = ze1(ji,jj) 203 zrdpsi = ze2(ji,jj) ! 1/zdelpsi 204 zpsi = ze3(ji,jj) * gdepw(ji,jj,jk,Kmm) ! gdepw/zze 205 ! 206 ! NB. make sure zchl value is such that: zchl = MIN( 10. , MAX( 0.03, zchl ) ) 207 zchl = MIN( 10. , MAX( 0.03, zCze * ( zCb + zCmax * EXP( -( (zpsi - zpsimax) * zrdpsi )**2 ) ) ) ) 208 ! Convert chlorophyll value to attenuation coefficient look-up table index 209 ztmp3d(ji,jj,jk) = 41 + 20.*LOG10(zchl) + 1.e-15 210 END_3D 211 ELSE !* constant chlorophyll 212 zchl = 0.05 213 ! NB. make sure constant value is such that: 214 zchl = MIN( 10. , MAX( 0.03, zchl ) ) 215 ! Convert chlorophyll value to attenuation coefficient look-up table index 216 zlui = 41 + 20.*LOG10(zchl) + 1.e-15 169 217 DO jk = 1, nksr + 1 170 DO jj = 2, jpjm1 ! Separation in R-G-B depending of the surface Chl 171 DO ji = 2, jpim1 172 zchl = MIN( 10. , MAX( 0.03, sf_chl(1)%fnow(ji,jj,1) ) ) 173 zCtot = 40.6 * zchl**0.459 174 zze = 568.2 * zCtot**(-0.746) 175 IF( zze > 102. ) zze = 200.0 * zCtot**(-0.293) 176 zpsi = gdepw(ji,jj,jk,Kmm) / zze 177 ! 178 zlogc = LOG( zchl ) 179 zlogc2 = zlogc * zlogc 180 zlogc3 = zlogc * zlogc * zlogc 181 zCb = 0.768 + 0.087 * zlogc - 0.179 * zlogc2 - 0.025 * zlogc3 182 zCmax = 0.299 - 0.289 * zlogc + 0.579 * zlogc2 183 zpsimax = 0.6 - 0.640 * zlogc + 0.021 * zlogc2 + 0.115 * zlogc3 184 zdelpsi = 0.710 + 0.159 * zlogc + 0.021 * zlogc2 185 zCze = 1.12 * (zchl)**0.803 186 ! 187 zchl3d(ji,jj,jk) = zCze * ( zCb + zCmax * EXP( -( (zpsi - zpsimax) / zdelpsi )**2 ) ) 188 END DO 189 ! 190 END DO 218 ztmp3d(:,:,jk) = zlui 191 219 END DO 192 ELSE !* constant chrlorophyll193 DO jk = 1, nksr + 1194 zchl3d(:,:,jk) = 0.05195 ENDDO196 220 ENDIF 197 221 ! 198 222 zcoef = ( 1. - rn_abs ) / 3._wp !* surface equi-partition in R-G-B 199 223 DO_2D_00_00 200 ze0(ji,jj,1) = rn_abs * qsr(ji,jj) 201 ze1(ji,jj,1) = zcoef * qsr(ji,jj) 202 ze2(ji,jj,1) = zcoef * qsr(ji,jj) 203 ze3(ji,jj,1) = zcoef * qsr(ji,jj) 204 zea(ji,jj,1) = qsr(ji,jj) 224 ze0(ji,jj) = rn_abs * qsr(ji,jj) 225 ze1(ji,jj) = zcoef * qsr(ji,jj) 226 ze2(ji,jj) = zcoef * qsr(ji,jj) 227 ze3(ji,jj) = zcoef * qsr(ji,jj) 228 ! store the surface SW radiation; re-use the surface ztmp3d array 229 ! since the surface attenuation coefficient is not used 230 ztmp3d(ji,jj,1) = qsr(ji,jj) 205 231 END_2D 206 232 ! 207 DO jk = 2, nksr+1 !* interior equi-partition in R-G-B depending of vertical profile of Chl 208 DO_2D_00_00 209 zchl = MIN( 10. , MAX( 0.03, zchl3d(ji,jj,jk) ) ) 210 irgb = NINT( 41 + 20.*LOG10(zchl) + 1.e-15 ) 211 zekb(ji,jj) = rkrgb(1,irgb) 212 zekg(ji,jj) = rkrgb(2,irgb) 213 zekr(ji,jj) = rkrgb(3,irgb) 214 END_2D 215 216 DO_2D_00_00 217 zc0 = ze0(ji,jj,jk-1) * EXP( - e3t(ji,jj,jk-1,Kmm) * xsi0r ) 218 zc1 = ze1(ji,jj,jk-1) * EXP( - e3t(ji,jj,jk-1,Kmm) * zekb(ji,jj) ) 219 zc2 = ze2(ji,jj,jk-1) * EXP( - e3t(ji,jj,jk-1,Kmm) * zekg(ji,jj) ) 220 zc3 = ze3(ji,jj,jk-1) * EXP( - e3t(ji,jj,jk-1,Kmm) * zekr(ji,jj) ) 221 ze0(ji,jj,jk) = zc0 222 ze1(ji,jj,jk) = zc1 223 ze2(ji,jj,jk) = zc2 224 ze3(ji,jj,jk) = zc3 225 zea(ji,jj,jk) = ( zc0 + zc1 + zc2 + zc3 ) * wmask(ji,jj,jk) 226 END_2D 227 END DO 233 !* interior equi-partition in R-G-B depending on vertical profile of Chl 234 DO_3D_00_00 ( 2, nksr + 1 ) 235 ze3t = e3t(ji,jj,jk-1,Kmm) 236 irgb = NINT( ztmp3d(ji,jj,jk) ) 237 zc0 = ze0(ji,jj) * EXP( - ze3t * xsi0r ) 238 zc1 = ze1(ji,jj) * EXP( - ze3t * rkrgb(1,irgb) ) 239 zc2 = ze2(ji,jj) * EXP( - ze3t * rkrgb(2,irgb) ) 240 zc3 = ze3(ji,jj) * EXP( - ze3t * rkrgb(3,irgb) ) 241 ze0(ji,jj) = zc0 242 ze1(ji,jj) = zc1 243 ze2(ji,jj) = zc2 244 ze3(ji,jj) = zc3 245 ztmp3d(ji,jj,jk) = ( zc0 + zc1 + zc2 + zc3 ) * wmask(ji,jj,jk) 246 END_3D 228 247 ! 229 248 DO_3D_00_00( 1, nksr ) 230 qsr_hc(ji,jj,jk) = r1_rho0_rcp * ( z ea(ji,jj,jk) - zea(ji,jj,jk+1) )249 qsr_hc(ji,jj,jk) = r1_rho0_rcp * ( ztmp3d(ji,jj,jk) - ztmp3d(ji,jj,jk+1) ) 231 250 END_3D 232 251 ! 233 DEALLOCATE( ze kb , zekg , zekr , ze0 , ze1 , ze2 , ze3 , zea , zchl3d )252 DEALLOCATE( ze0 , ze1 , ze2 , ze3 , ztmp3d ) 234 253 ! 235 254 CASE( np_2BD ) !== 2-bands fluxes ==! -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/tests/CANAL/MY_SRC/stpctl.F90
r13193 r13217 19 19 USE dom_oce ! ocean space and time domain variables 20 20 USE c1d ! 1D vertical configuration 21 USE zdf_oce , ONLY : ln_zad_Aimp ! ocean vertical physics variables22 USE wet_dry, ONLY : ll_wd, ssh_ref ! reference depth for negative bathy23 !24 21 USE diawri ! Standard run outputs (dia_wri_state routine) 22 ! 25 23 USE in_out_manager ! I/O manager 26 24 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 27 25 USE lib_mpp ! distributed memory computing 28 ! 26 USE zdf_oce , ONLY : ln_zad_Aimp ! ocean vertical physics variables 27 USE wet_dry, ONLY : ll_wd, ssh_ref ! reference depth for negative bathy 28 29 29 USE netcdf ! NetCDF library 30 30 IMPLICIT NONE … … 33 33 PUBLIC stp_ctl ! routine called by step.F90 34 34 35 INTEGER :: nrunid ! netcdf file id36 INTEGER, DIMENSION(8) :: nvarid ! netcdf variable id35 INTEGER :: idrun, idtime, idssh, idu, ids1, ids2, idt1, idt2, idc1, idw1, istatus 36 LOGICAL :: lsomeoce 37 37 !!---------------------------------------------------------------------- 38 38 !! NEMO/OCE 4.0 , NEMO Consortium (2018) … … 42 42 CONTAINS 43 43 44 SUBROUTINE stp_ctl( kt, K mm)44 SUBROUTINE stp_ctl( kt, Kbb, Kmm, kindic ) 45 45 !!---------------------------------------------------------------------- 46 46 !! *** ROUTINE stp_ctl *** … … 50 50 !! ** Method : - Save the time step in numstp 51 51 !! - Print it each 50 time steps 52 !! - Stop the run IF problem encountered by setting nstop > 052 !! - Stop the run IF problem encountered by setting indic=-3 53 53 !! Problems checked: |ssh| maximum larger than 10 m 54 54 !! |U| maximum larger than 10 m/s … … 57 57 !! ** Actions : "time.step" file = last ocean time-step 58 58 !! "run.stat" file = run statistics 59 !! nstop indicator sheared among all local domain59 !! nstop indicator sheared among all local domain (lk_mpp=T) 60 60 !!---------------------------------------------------------------------- 61 61 INTEGER, INTENT(in ) :: kt ! ocean time-step index 62 INTEGER, INTENT(in ) :: Kmm ! ocean time level index 62 INTEGER, INTENT(in ) :: Kbb, Kmm ! ocean time level index 63 INTEGER, INTENT(inout) :: kindic ! error indicator 63 64 !! 64 INTEGER :: ji ! dummy loop indices 65 INTEGER :: idtime, istatus 66 INTEGER , DIMENSION(9) :: iareasum, iareamin, iareamax 67 INTEGER , DIMENSION(3,4) :: iloc ! min/max loc indices 68 REAL(wp) :: zzz ! local real 69 REAL(wp), DIMENSION(9) :: zmax, zmaxlocal 70 LOGICAL :: ll_wrtstp, ll_colruns, ll_wrtruns 71 LOGICAL, DIMENSION(jpi,jpj,jpk) :: llmsk 72 CHARACTER(len=20) :: clname 65 INTEGER :: ji, jj, jk ! dummy loop indices 66 INTEGER, DIMENSION(2) :: ih ! min/max loc indices 67 INTEGER, DIMENSION(3) :: iu, is1, is2 ! min/max loc indices 68 REAL(wp) :: zzz ! local real 69 REAL(wp), DIMENSION(9) :: zmax 70 LOGICAL :: ll_wrtstp, ll_colruns, ll_wrtruns 71 CHARACTER(len=20) :: clname 73 72 !!---------------------------------------------------------------------- 74 IF( nstop > 0 .AND. ngrdstop > -1 ) RETURN ! stpctl was already called by a child grid 75 ! 76 ll_wrtstp = ( MOD( kt-nit000, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 77 ll_colruns = ll_wrtstp .AND. sn_cfctl%l_runstat .AND. jpnij > 1 78 ll_wrtruns = ( ll_colruns .OR. jpnij == 1 ) .AND. lwm 79 ! 80 IF( kt == nit000 ) THEN 81 ! 82 IF( lwp ) THEN 83 WRITE(numout,*) 84 WRITE(numout,*) 'stp_ctl : time-stepping control' 85 WRITE(numout,*) '~~~~~~~' 86 ENDIF 87 ! ! open time.step ascii file, done only by 1st subdomain 88 IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 89 ! 90 IF( ll_wrtruns ) THEN 91 ! ! open run.stat ascii file, done only by 1st subdomain 73 ! 74 ll_wrtstp = ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 75 ll_colruns = ll_wrtstp .AND. ( sn_cfctl%l_runstat ) 76 ll_wrtruns = ll_colruns .AND. lwm 77 IF( kt == nit000 .AND. lwp ) THEN 78 WRITE(numout,*) 79 WRITE(numout,*) 'stp_ctl : time-stepping control' 80 WRITE(numout,*) '~~~~~~~' 81 ! ! open time.step file 82 IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 83 ! ! open run.stat file(s) at start whatever 84 ! ! the value of sn_cfctl%ptimincr 85 IF( lwm .AND. ( sn_cfctl%l_runstat ) ) THEN 92 86 CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 93 ! ! open run.stat.nc netcdf file, done only by 1st subdomain94 87 clname = 'run.stat.nc' 95 88 IF( .NOT. Agrif_Root() ) clname = TRIM(Agrif_CFixed())//"_"//TRIM(clname) 96 istatus = NF90_CREATE( TRIM(clname), NF90_CLOBBER, nrunid)97 istatus = NF90_DEF_DIM( nrunid, 'time', NF90_UNLIMITED, idtime )98 istatus = NF90_DEF_VAR( nrunid, 'abs_ssh_max', NF90_DOUBLE, (/ idtime /), nvarid(1))99 istatus = NF90_DEF_VAR( nrunid, 'abs_u_max', NF90_DOUBLE, (/ idtime /), nvarid(2))100 istatus = NF90_DEF_VAR( nrunid, 's_min', NF90_DOUBLE, (/ idtime /), nvarid(3))101 istatus = NF90_DEF_VAR( nrunid, 's_max', NF90_DOUBLE, (/ idtime /), nvarid(4))102 istatus = NF90_DEF_VAR( nrunid, 't_min', NF90_DOUBLE, (/ idtime /), nvarid(5))103 istatus = NF90_DEF_VAR( nrunid, 't_max', NF90_DOUBLE, (/ idtime /), nvarid(6))89 istatus = NF90_CREATE( TRIM(clname), NF90_CLOBBER, idrun ) 90 istatus = NF90_DEF_DIM( idrun, 'time', NF90_UNLIMITED, idtime ) 91 istatus = NF90_DEF_VAR( idrun, 'abs_ssh_max', NF90_DOUBLE, (/ idtime /), idssh ) 92 istatus = NF90_DEF_VAR( idrun, 'abs_u_max', NF90_DOUBLE, (/ idtime /), idu ) 93 istatus = NF90_DEF_VAR( idrun, 's_min', NF90_DOUBLE, (/ idtime /), ids1 ) 94 istatus = NF90_DEF_VAR( idrun, 's_max', NF90_DOUBLE, (/ idtime /), ids2 ) 95 istatus = NF90_DEF_VAR( idrun, 't_min', NF90_DOUBLE, (/ idtime /), idt1 ) 96 istatus = NF90_DEF_VAR( idrun, 't_max', NF90_DOUBLE, (/ idtime /), idt2 ) 104 97 IF( ln_zad_Aimp ) THEN 105 istatus = NF90_DEF_VAR( nrunid, 'Cf_max', NF90_DOUBLE, (/ idtime /), nvarid(7))106 istatus = NF90_DEF_VAR( nrunid,'abs_wi_max',NF90_DOUBLE, (/ idtime /), nvarid(8))98 istatus = NF90_DEF_VAR( idrun, 'abs_wi_max', NF90_DOUBLE, (/ idtime /), idw1 ) 99 istatus = NF90_DEF_VAR( idrun, 'Cf_max', NF90_DOUBLE, (/ idtime /), idc1 ) 107 100 ENDIF 108 istatus = NF90_ENDDEF(nrunid) 109 ENDIF 110 ! 111 ENDIF 112 ! 113 ! !== write current time step ==! 114 ! !== done only by 1st subdomain at writting timestep ==! 115 IF( lwm .AND. ll_wrtstp ) THEN 101 istatus = NF90_ENDDEF(idrun) 102 zmax(8:9) = 0._wp ! initialise to zero in case ln_zad_Aimp option is not in use 103 ENDIF 104 ENDIF 105 IF( kt == nit000 ) lsomeoce = COUNT( ssmask(:,:) == 1._wp ) > 0 106 ! 107 IF(lwm .AND. ll_wrtstp) THEN !== current time step ==! ("time.step" file) 116 108 WRITE ( numstp, '(1x, i8)' ) kt 117 109 REWIND( numstp ) 118 110 ENDIF 119 ! !== test of local extrema ==! 120 ! !== done by all processes at every time step ==! 121 ! 122 ! define zmax default value. needed for land processors 123 IF( ll_colruns ) THEN ! default value: must not be kept when calling mpp_max -> must be as small as possible 124 zmax(:) = -HUGE(1._wp) 125 ELSE ! default value: must not give true for any of the tests bellow (-> avoid manipulating HUGE...) 126 zmax(:) = 0._wp 127 zmax(3) = -1._wp ! avoid salinity minimum at 0. 128 ENDIF 129 ! 130 llmsk(:,:,1) = ssmask(:,:) == 1._wp 131 IF( COUNT( llmsk(:,:,1) ) > 0 ) THEN ! avoid huge values sent back for land processors... 132 IF( ll_wd ) THEN 133 zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm) + ssh_ref ), mask = llmsk(:,:,1) ) ! ssh max 134 ELSE 135 zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm) ), mask = llmsk(:,:,1) ) ! ssh max 136 ENDIF 137 ENDIF 138 zmax(2) = MAXVAL( ABS( uu(:,:,:,Kmm) ) ) ! velocity max (zonal only) 139 llmsk(:,:,:) = tmask(:,:,:) == 1._wp 140 IF( COUNT( llmsk(:,:,:) ) > 0 ) THEN ! avoid huge values sent back for land processors... 141 zmax(3) = MAXVAL( -ts(:,:,:,jp_sal,Kmm), mask = llmsk ) ! minus salinity max 142 zmax(4) = MAXVAL( ts(:,:,:,jp_sal,Kmm), mask = llmsk ) ! salinity max 143 IF( ll_colruns .OR. jpnij == 1 ) THEN ! following variables are used only in the netcdf file 144 zmax(5) = MAXVAL( -ts(:,:,:,jp_tem,Kmm), mask = llmsk ) ! minus temperature max 145 zmax(6) = MAXVAL( ts(:,:,:,jp_tem,Kmm), mask = llmsk ) ! temperature max 146 IF( ln_zad_Aimp ) THEN 147 zmax(7) = MAXVAL( Cu_adv(:,:,:) , mask = llmsk ) ! partitioning coeff. max 148 llmsk(:,:,:) = wmask(:,:,:) == 1._wp 149 IF( COUNT( llmsk(:,:,:) ) > 0 ) THEN ! avoid huge values sent back for land processors... 150 zmax(8) = MAXVAL(ABS( wi(:,:,:) ), mask = llmsk ) ! implicit vertical vel. max 151 ENDIF 152 ENDIF 153 ENDIF 154 ENDIF 155 zmax(9) = REAL( nstop, wp ) ! stop indicator 156 ! !== get global extrema ==! 157 ! !== done by all processes if writting run.stat ==! 111 ! 112 ! !== test of extrema ==! 113 IF( ll_wd ) THEN 114 zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm) + ssh_ref*tmask(:,:,1) ) ) ! ssh max 115 ELSE 116 zmax(1) = MAXVAL( ABS( ssh(:,:,Kmm) ) ) ! ssh max 117 ENDIF 118 zmax(2) = MAXVAL( ABS( uu(:,:,:,Kmm) ) ) ! velocity max (zonal only) 119 zmax(3) = MAXVAL( -ts(:,:,:,jp_sal,Kmm) , mask = tmask(:,:,:) == 1._wp ) ! minus salinity max 120 zmax(4) = MAXVAL( ts(:,:,:,jp_sal,Kmm) , mask = tmask(:,:,:) == 1._wp ) ! salinity max 121 zmax(5) = MAXVAL( -ts(:,:,:,jp_tem,Kmm) , mask = tmask(:,:,:) == 1._wp ) ! minus temperature max 122 zmax(6) = MAXVAL( ts(:,:,:,jp_tem,Kmm) , mask = tmask(:,:,:) == 1._wp ) ! temperature max 123 zmax(7) = REAL( nstop , wp ) ! stop indicator 124 IF( ln_zad_Aimp ) THEN 125 zmax(8) = MAXVAL( ABS( wi(:,:,:) ) , mask = wmask(:,:,:) == 1._wp ) ! implicit vertical vel. max 126 zmax(9) = MAXVAL( Cu_adv(:,:,:) , mask = tmask(:,:,:) == 1._wp ) ! partitioning coeff. max 127 ENDIF 128 ! 158 129 IF( ll_colruns ) THEN 159 zmaxlocal(:) = zmax(:)160 130 CALL mpp_max( "stpctl", zmax ) ! max over the global domain 161 nstop = NINT( zmax(9) ) ! update nstop indicator (now sheared among all local domains) 162 ENDIF 163 ! !== write "run.stat" files ==! 164 ! !== done only by 1st subdomain at writting timestep ==! 131 nstop = NINT( zmax(7) ) ! nstop indicator sheared among all local domains 132 ENDIF 133 ! !== run statistics ==! ("run.stat" files) 165 134 IF( ll_wrtruns ) THEN 166 135 WRITE(numrun,9500) kt, zmax(1), zmax(2), -zmax(3), zmax(4) 167 istatus = NF90_PUT_VAR( nrunid, nvarid(1), (/ zmax(1)/), (/kt/), (/1/) )168 istatus = NF90_PUT_VAR( nrunid, nvarid(2), (/ zmax(2)/), (/kt/), (/1/) )169 istatus = NF90_PUT_VAR( nrunid, nvarid(3), (/-zmax(3)/), (/kt/), (/1/) )170 istatus = NF90_PUT_VAR( nrunid, nvarid(4), (/ zmax(4)/), (/kt/), (/1/) )171 istatus = NF90_PUT_VAR( nrunid, nvarid(5), (/-zmax(5)/), (/kt/), (/1/) )172 istatus = NF90_PUT_VAR( nrunid, nvarid(6), (/ zmax(6)/), (/kt/), (/1/) )136 istatus = NF90_PUT_VAR( idrun, idssh, (/ zmax(1)/), (/kt/), (/1/) ) 137 istatus = NF90_PUT_VAR( idrun, idu, (/ zmax(2)/), (/kt/), (/1/) ) 138 istatus = NF90_PUT_VAR( idrun, ids1, (/-zmax(3)/), (/kt/), (/1/) ) 139 istatus = NF90_PUT_VAR( idrun, ids2, (/ zmax(4)/), (/kt/), (/1/) ) 140 istatus = NF90_PUT_VAR( idrun, idt1, (/-zmax(5)/), (/kt/), (/1/) ) 141 istatus = NF90_PUT_VAR( idrun, idt2, (/ zmax(6)/), (/kt/), (/1/) ) 173 142 IF( ln_zad_Aimp ) THEN 174 istatus = NF90_PUT_VAR( nrunid, nvarid(7), (/ zmax(7)/), (/kt/), (/1/) ) 175 istatus = NF90_PUT_VAR( nrunid, nvarid(8), (/ zmax(8)/), (/kt/), (/1/) ) 176 ENDIF 177 IF( kt == nitend ) istatus = NF90_CLOSE(nrunid) 143 istatus = NF90_PUT_VAR( idrun, idw1, (/ zmax(8)/), (/kt/), (/1/) ) 144 istatus = NF90_PUT_VAR( idrun, idc1, (/ zmax(9)/), (/kt/), (/1/) ) 145 ENDIF 146 IF( MOD( kt , 100 ) == 0 ) istatus = NF90_SYNC(idrun) 147 IF( kt == nitend ) istatus = NF90_CLOSE(idrun) 178 148 END IF 179 ! !== error handling ==! 180 ! !== done by all processes at every time step ==! 181 ! 182 IF( zmax(1) > 20._wp .OR. & ! too large sea surface height ( > 20 m ) 183 & zmax(2) > 10._wp .OR. & ! too large velocity ( > 10 m/s) 184 !!$ & zmax(3) >= 0._wp .OR. & ! negative or zero sea surface salinity 185 !!$ & zmax(4) >= 100._wp .OR. & ! too large sea surface salinity ( > 100 ) 186 !!$ & zmax(4) < 0._wp .OR. & ! too large sea surface salinity (keep this line for sea-ice) 187 & ISNAN( zmax(1) + zmax(2) + zmax(3) ) .OR. & ! NaN encounter in the tests 188 & ABS( zmax(1) + zmax(2) + zmax(3) ) > HUGE(1._wp) ) THEN ! Infinity encounter in the tests 149 ! !== error handling ==! 150 IF( ( sn_cfctl%l_glochk .OR. lsomeoce ) .AND. ( & ! domain contains some ocean points, check for sensible ranges 151 & zmax(1) > 20._wp .OR. & ! too large sea surface height ( > 20 m ) 152 & zmax(2) > 10._wp .OR. & ! too large velocity ( > 10 m/s) 153 !!$ & zmax(3) >= 0._wp .OR. & ! negative or zero sea surface salinity 154 !!$ & zmax(4) >= 100._wp .OR. & ! too large sea surface salinity ( > 100 ) 155 !!$ & zmax(4) < 0._wp .OR. & ! too large sea surface salinity (keep this line for sea-ice) 156 & ISNAN( zmax(1) + zmax(2) + zmax(3) ) ) ) THEN ! NaN encounter in the tests 157 IF( lk_mpp .AND. sn_cfctl%l_glochk ) THEN 158 ! have use mpp_max (because sn_cfctl%l_glochk=.T. and distributed) 159 CALL mpp_maxloc( 'stpctl', ABS(ssh(:,:,Kmm)) , ssmask(:,:) , zzz, ih ) 160 CALL mpp_maxloc( 'stpctl', ABS(uu(:,:,:,Kmm)) , umask (:,:,:), zzz, iu ) 161 CALL mpp_minloc( 'stpctl', ts(:,:,:,jp_sal,Kmm), tmask (:,:,:), zzz, is1 ) 162 CALL mpp_maxloc( 'stpctl', ts(:,:,:,jp_sal,Kmm), tmask (:,:,:), zzz, is2 ) 163 ELSE 164 ! find local min and max locations 165 ih(:) = MAXLOC( ABS( ssh(:,:,Kmm) ) ) + (/ nimpp - 1, njmpp - 1 /) 166 iu(:) = MAXLOC( ABS( uu (:,:,:,Kmm) ) ) + (/ nimpp - 1, njmpp - 1, 0 /) 167 is1(:) = MINLOC( ts(:,:,:,jp_sal,Kmm), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 168 is2(:) = MAXLOC( ts(:,:,:,jp_sal,Kmm), mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 169 ENDIF 170 171 WRITE(ctmp1,*) ' stp_ctl: |ssh| > 20 m or |U| > 10 m/s or S <= 0 or S >= 100 or NaN encounter in the tests' 172 WRITE(ctmp2,9100) kt, zmax(1), ih(1) , ih(2) 173 WRITE(ctmp3,9200) kt, zmax(2), iu(1) , iu(2) , iu(3) 174 WRITE(ctmp4,9300) kt, - zmax(3), is1(1), is1(2), is1(3) 175 WRITE(ctmp5,9400) kt, zmax(4), is2(1), is2(2), is2(3) 176 WRITE(ctmp6,*) ' ===> output of last computed fields in output.abort.nc file' 177 178 CALL dia_wri_state( Kmm, 'output.abort' ) ! create an output.abort file 179 180 IF( .NOT. sn_cfctl%l_glochk ) THEN 181 WRITE(ctmp8,*) 'E R R O R message from sub-domain: ', narea 182 CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp8, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ctmp6 ) 183 ELSE 184 CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6, ' ' ) 185 ENDIF 186 187 kindic = -3 189 188 ! 190 iloc(:,:) = 0 191 IF( ll_colruns ) THEN ! zmax is global, so it is the same on all subdomains -> no dead lock with mpp_maxloc 192 ! first: close the netcdf file, so we can read it 193 IF( lwm .AND. kt /= nitend ) istatus = NF90_CLOSE(nrunid) 194 ! get global loc on the min/max 195 CALL mpp_maxloc( 'stpctl', ABS(ssh(:,:, Kmm)), ssmask(:,: ), zzz, iloc(1:2,1) ) ! mpp_maxloc ok if mask = F 196 CALL mpp_maxloc( 'stpctl', ABS( uu(:,:,:, Kmm)), umask(:,:,:), zzz, iloc(1:3,2) ) 197 CALL mpp_minloc( 'stpctl', ts(:,:,:,jp_sal,Kmm) , tmask(:,:,:), zzz, iloc(1:3,3) ) 198 CALL mpp_maxloc( 'stpctl', ts(:,:,:,jp_sal,Kmm) , tmask(:,:,:), zzz, iloc(1:3,4) ) 199 ! find which subdomain has the max. 200 iareamin(:) = jpnij+1 ; iareamax(:) = 0 ; iareasum(:) = 0 201 DO ji = 1, 9 202 IF( zmaxlocal(ji) == zmax(ji) ) THEN 203 iareamin(ji) = narea ; iareamax(ji) = narea ; iareasum(ji) = 1 204 ENDIF 205 END DO 206 CALL mpp_min( "stpctl", iareamin ) ! min over the global domain 207 CALL mpp_max( "stpctl", iareamax ) ! max over the global domain 208 CALL mpp_sum( "stpctl", iareasum ) ! sum over the global domain 209 ELSE ! find local min and max locations: 210 ! if we are here, this means that the subdomain contains some oce points -> no need to test the mask used in maxloc 211 iloc(1:2,1) = MAXLOC( ABS( ssh(:,:, Kmm)), mask = ssmask(:,: ) == 1._wp ) + (/ nimpp - 1, njmpp - 1 /) 212 iloc(1:3,2) = MAXLOC( ABS( uu(:,:,:, Kmm)), mask = umask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 213 iloc(1:3,3) = MINLOC( ts(:,:,:,jp_sal,Kmm) , mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 214 iloc(1:3,4) = MAXLOC( ts(:,:,:,jp_sal,Kmm) , mask = tmask(:,:,:) == 1._wp ) + (/ nimpp - 1, njmpp - 1, 0 /) 215 iareamin(:) = narea ; iareamax(:) = narea ; iareasum(:) = 1 ! this is local information 216 ENDIF 217 ! 218 WRITE(ctmp1,*) ' stp_ctl: |ssh| > 20 m or |U| > 10 m/s or S <= 0 or S >= 100 or NaN encounter in the tests' 219 CALL wrt_line( ctmp2, kt, '|ssh| max', zmax(1), iloc(:,1), iareasum(1), iareamin(1), iareamax(1) ) 220 CALL wrt_line( ctmp3, kt, '|U| max', zmax(2), iloc(:,2), iareasum(2), iareamin(2), iareamax(2) ) 221 CALL wrt_line( ctmp4, kt, 'Sal min', -zmax(3), iloc(:,3), iareasum(3), iareamin(3), iareamax(3) ) 222 CALL wrt_line( ctmp5, kt, 'Sal max', zmax(4), iloc(:,4), iareasum(4), iareamin(4), iareamax(4) ) 223 IF( Agrif_Root() ) THEN 224 WRITE(ctmp6,*) ' ===> output of last computed fields in output.abort* files' 225 ELSE 226 WRITE(ctmp6,*) ' ===> output of last computed fields in '//TRIM(Agrif_CFixed())//'_output.abort* files' 227 ENDIF 228 ! 229 CALL dia_wri_state( Kmm, 'output.abort' ) ! create an output.abort file 230 ! 231 IF( ll_colruns .or. jpnij == 1 ) THEN ! all processes synchronized -> use lwp to print in opened ocean.output files 232 IF(lwp) THEN ; CALL ctl_stop( ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 ) 233 ELSE ; nstop = MAX(1, nstop) ! make sure nstop > 0 (automatically done when calling ctl_stop) 234 ENDIF 235 ELSE ! only mpi subdomains with errors are here -> STOP now 236 CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ctmp3, ctmp4, ctmp5, ' ', ctmp6 ) 237 ENDIF 238 ! 239 ENDIF 240 ! 241 IF( nstop > 0 ) THEN ! an error was detected and we did not abort yet... 242 ngrdstop = Agrif_Fixed() ! store which grid got this error 243 IF( .NOT. ll_colruns .AND. jpnij > 1 ) CALL ctl_stop( 'STOP' ) ! we must abort here to avoid MPI deadlock 244 ENDIF 245 ! 189 ENDIF 190 ! 191 9100 FORMAT (' kt=',i8,' |ssh| max: ',1pg11.4,', at i j : ',2i5) 192 9200 FORMAT (' kt=',i8,' |U| max: ',1pg11.4,', at i j k: ',3i5) 193 9300 FORMAT (' kt=',i8,' S min: ',1pg11.4,', at i j k: ',3i5) 194 9400 FORMAT (' kt=',i8,' S max: ',1pg11.4,', at i j k: ',3i5) 246 195 9500 FORMAT(' it :', i8, ' |ssh|_max: ', D23.16, ' |U|_max: ', D23.16,' S_min: ', D23.16,' S_max: ', D23.16) 247 196 ! 248 197 END SUBROUTINE stp_ctl 249 250 251 SUBROUTINE wrt_line( cdline, kt, cdprefix, pval, kloc, ksum, kmin, kmax )252 !!----------------------------------------------------------------------253 !! *** ROUTINE wrt_line ***254 !!255 !! ** Purpose : write information line256 !!257 !!----------------------------------------------------------------------258 CHARACTER(len=*), INTENT( out) :: cdline259 CHARACTER(len=*), INTENT(in ) :: cdprefix260 REAL(wp), INTENT(in ) :: pval261 INTEGER, DIMENSION(3), INTENT(in ) :: kloc262 INTEGER, INTENT(in ) :: kt, ksum, kmin, kmax263 !264 CHARACTER(len=80) :: clsuff265 CHARACTER(len=9 ) :: clkt, clsum, clmin, clmax266 CHARACTER(len=9 ) :: cli, clj, clk267 CHARACTER(len=1 ) :: clfmt268 CHARACTER(len=4 ) :: cl4 ! needed to be able to compile with Agrif, I don't know why269 INTEGER :: ifmtk270 !!----------------------------------------------------------------------271 WRITE(clkt , '(i9)') kt272 273 WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpnij ,wp))) + 1 ! how many digits to we need to write ? (we decide max = 9)274 !!! WRITE(clsum, '(i'//clfmt//')') ksum ! this is creating a compilation error with AGRIF275 cl4 = '(i'//clfmt//')' ; WRITE(clsum, cl4) ksum276 WRITE(clfmt, '(i1)') INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1 ! how many digits to we need to write ? (we decide max = 9)277 cl4 = '(i'//clfmt//')' ; WRITE(clmin, cl4) kmin-1278 WRITE(clmax, cl4) kmax-1279 !280 WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpiglo,wp))) + 1 ! how many digits to we need to write jpiglo? (we decide max = 9)281 cl4 = '(i'//clfmt//')' ; WRITE(cli, cl4) kloc(1) ! this is ok with AGRIF282 WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpjglo,wp))) + 1 ! how many digits to we need to write jpjglo? (we decide max = 9)283 cl4 = '(i'//clfmt//')' ; WRITE(clj, cl4) kloc(2) ! this is ok with AGRIF284 !285 IF( ksum == 1 ) THEN ; WRITE(clsuff,9100) TRIM(clmin)286 ELSE ; WRITE(clsuff,9200) TRIM(clsum), TRIM(clmin), TRIM(clmax)287 ENDIF288 IF(kloc(3) == 0) THEN289 ifmtk = INT(LOG10(REAL(jpk,wp))) + 1 ! how many digits to we need to write jpk? (we decide max = 9)290 clk = REPEAT(' ', ifmtk) ! create the equivalent in blank string291 WRITE(cdline,9300) TRIM(ADJUSTL(clkt)), TRIM(ADJUSTL(cdprefix)), pval, TRIM(cli), TRIM(clj), clk(1:ifmtk), TRIM(clsuff)292 ELSE293 WRITE(clfmt, '(i1)') INT(LOG10(REAL(jpk,wp))) + 1 ! how many digits to we need to write jpk? (we decide max = 9)294 !!! WRITE(clk, '(i'//clfmt//')') kloc(3) ! this is creating a compilation error with AGRIF295 cl4 = '(i'//clfmt//')' ; WRITE(clk, cl4) kloc(3) ! this is ok with AGRIF296 WRITE(cdline,9400) TRIM(ADJUSTL(clkt)), TRIM(ADJUSTL(cdprefix)), pval, TRIM(cli), TRIM(clj), TRIM(clk), TRIM(clsuff)297 ENDIF298 !299 9100 FORMAT('MPI rank ', a)300 9200 FORMAT('found in ', a, ' MPI tasks, spread out among ranks ', a, ' to ', a)301 9300 FORMAT('kt ', a, ' ', a, ' ', 1pg11.4, ' at i j ', a, ' ', a, ' ', a, ' ', a)302 9400 FORMAT('kt ', a, ' ', a, ' ', 1pg11.4, ' at i j k ', a, ' ', a, ' ', a, ' ', a)303 !304 END SUBROUTINE wrt_line305 306 198 307 199 !!====================================================================== -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/tests/README.rst
r11743 r13217 205 205 :style: unsrt 206 206 :labelprefix: T 207 208 CPL_OASIS 209 --------- 210 | This test case checks the OASIS interface in OCE/SBC, allowing to set up 211 a coupled configuration through OASIS. See CPL_OASIS/README.md for more information. -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/tests/STATION_ASF/EXPREF/launch_sasf.sh
r13193 r13217 1 1 #!/bin/bash 2 2 3 ################################################################ 4 # 5 # Script to launch a set of STATION_ASF simulations 6 # 7 # L. Brodeau, 2020 8 # 9 ################################################################ 3 # NEMO directory where to fetch compiled STATION_ASF nemo.exe + setup: 4 NEMO_DIR=`pwd | sed -e "s|/tests/STATION_ASF/EXPREF||g"` 10 5 11 # What directory inside "tests" actually contains the compiled "nemo.exe" for STATION_ASF ? 6 echo "Using NEMO_DIR=${NEMO_DIR}" 7 8 # what directory inside "tests" actually contains the compiled test-case? 12 9 TC_DIR="STATION_ASF2" 13 10 14 # DATA_IN_DIR => Directory containing sea-surface + atmospheric forcings 11 # => so the executable to use is: 12 NEMO_EXE="${NEMO_DIR}/tests/${TC_DIR}/BLD/bin/nemo.exe" 13 14 # Directory where to run the simulation: 15 WORK_DIR="${HOME}/tmp/STATION_ASF" 16 17 18 # FORC_DIR => Directory containing sea-surface + atmospheric forcings 15 19 # (get it there https://drive.google.com/file/d/1MxNvjhRHmMrL54y6RX7WIaM9-LGl--ZP/): 16 20 if [ `hostname` = "merlat" ]; then 17 DATA_IN_DIR="/MEDIA/data/STATION_ASF/input_data_STATION_ASF_2016-2018"21 FORC_DIR="/MEDIA/data/STATION_ASF/input_data_STATION_ASF_2016-2018" 18 22 elif [ `hostname` = "luitel" ]; then 19 DATA_IN_DIR="/data/gcm_setup/STATION_ASF/input_data_STATION_ASF_2016-2018"23 FORC_DIR="/data/gcm_setup/STATION_ASF/input_data_STATION_ASF_2016-2018" 20 24 elif [ `hostname` = "ige-meom-cal1" ]; then 21 DATA_IN_DIR="/mnt/meom/workdir/brodeau/STATION_ASF/input_data_STATION_ASF_2016-2018"25 FORC_DIR="/mnt/meom/workdir/brodeau/STATION_ASF/input_data_STATION_ASF_2016-2018" 22 26 elif [ `hostname` = "salvelinus" ]; then 23 DATA_IN_DIR="/opt/data/STATION_ASF/input_data_STATION_ASF_2016-2018"27 FORC_DIR="/opt/data/STATION_ASF/input_data_STATION_ASF_2016-2018" 24 28 else 25 echo " Oops! We don't know `hostname` yet! Define 'DATA_IN_DIR' in the script!"; exit29 echo "Boo!"; exit 26 30 fi 27 28 expdir=`basename ${PWD}`; # we expect "EXPREF" or "EXP00" normally... 29 30 # NEMOGCM root directory where to fetch compiled STATION_ASF nemo.exe + setup: 31 NEMO_WRK_DIR=`pwd | sed -e "s|/tests/STATION_ASF/${expdir}||g"` 32 33 # Directory where to run the simulation: 34 PROD_DIR="${HOME}/tmp/STATION_ASF" 31 #====================== 32 mkdir -p ${WORK_DIR} 35 33 36 34 37 ####### End of normal user configurable section ####### 35 if [ ! -f ${NEMO_EXE} ]; then echo " Mhhh, no compiled nemo.exe found into ${NEMO_DIR}/tests/STATION_ASF/BLD/bin !"; exit; fi 38 36 39 #================================================================================ 40 41 # NEMO executable to use is: 42 NEMO_EXE="${NEMO_WRK_DIR}/tests/${TC_DIR}/BLD/bin/nemo.exe" 43 44 45 echo "###########################################################" 46 echo "# S T A T I O N A i r - S e a F l u x #" 47 echo "###########################################################" 48 echo 49 echo " We shall work in here: ${STATION_ASF_DIR}/" 50 echo " NEMOGCM work depository is: ${NEMO_WRK_DIR}/" 51 echo " ==> NEMO EXE to use: ${NEMO_EXE}" 52 echo " Input forcing data into: ${DATA_IN_DIR}/" 53 echo " Production will be done into: ${PROD_DIR}/" 54 echo 55 56 mkdir -p ${PROD_DIR} 57 58 if [ ! -f ${NEMO_EXE} ]; then echo " Mhhh, no compiled 'nemo.exe' found into `dirname ${NEMO_EXE}` !"; exit; fi 59 60 echo 61 echo " *** Using the following NEMO executable:" 62 echo " ${NEMO_EXE} " 63 echo 64 65 NEMO_EXPREF="${NEMO_WRK_DIR}/tests/STATION_ASF/EXPREF" 37 NEMO_EXPREF="${NEMO_DIR}/tests/STATION_ASF/EXPREF" 66 38 if [ ! -d ${NEMO_EXPREF} ]; then echo " Mhhh, no EXPREF directory ${NEMO_EXPREF} !"; exit; fi 67 39 68 rsync -avP ${NEMO_EXE} ${ PROD_DIR}/40 rsync -avP ${NEMO_EXE} ${WORK_DIR}/ 69 41 70 42 for ff in "context_nemo.xml" "domain_def_nemo.xml" "field_def_nemo-oce.xml" "file_def_nemo-oce.xml" "grid_def_nemo.xml" "iodef.xml" "namelist_ref"; do 71 43 if [ ! -f ${NEMO_EXPREF}/${ff} ]; then echo " Mhhh, ${ff} not found into ${NEMO_EXPREF} !"; exit; fi 72 rsync -avPL ${NEMO_EXPREF}/${ff} ${ PROD_DIR}/44 rsync -avPL ${NEMO_EXPREF}/${ff} ${WORK_DIR}/ 73 45 done 74 46 75 47 # Copy forcing to work directory: 76 rsync -avP ${ DATA_IN_DIR}/Station_PAPA_50N-145W*.nc ${PROD_DIR}/48 rsync -avP ${FORC_DIR}/Station_PAPA_50N-145W*.nc ${WORK_DIR}/ 77 49 78 50 for CASE in "ECMWF" "COARE3p6" "NCAR" "ECMWF-noskin" "COARE3p6-noskin"; do … … 86 58 scase=`echo "${CASE}" | tr '[:upper:]' '[:lower:]'` 87 59 88 rm -f ${ PROD_DIR}/namelist_cfg89 rsync -avPL ${NEMO_EXPREF}/namelist_${scase}_cfg ${ PROD_DIR}/namelist_cfg60 rm -f ${WORK_DIR}/namelist_cfg 61 rsync -avPL ${NEMO_EXPREF}/namelist_${scase}_cfg ${WORK_DIR}/namelist_cfg 90 62 91 cd ${ PROD_DIR}/63 cd ${WORK_DIR}/ 92 64 echo 93 65 echo "Launching NEMO !" -
NEMO/branches/2020/dev_r12377_KERNEL-06_techene_e3/tests/demo_cfgs.txt
r12377 r13217 11 11 BENCH OCE ICE TOP 12 12 STATION_ASF OCE 13 CPL_OASIS OCE TOP ICE NST
Note: See TracChangeset
for help on using the changeset viewer.