[3362] | 1 | MODULE sbcssm |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE sbcssm *** |
---|
| 4 | !! Off-line : interpolation of the physical fields |
---|
| 5 | !!====================================================================== |
---|
[9169] | 6 | !! History : 3.4 ! 2012-03 (S. Alderson) original code |
---|
[3362] | 7 | !!---------------------------------------------------------------------- |
---|
| 8 | |
---|
| 9 | !!---------------------------------------------------------------------- |
---|
[9169] | 10 | !! sbc_ssm_init : initialization, namelist read, and SAVEs control |
---|
| 11 | !! sbc_ssm : Interpolation of the fields |
---|
[3362] | 12 | !!---------------------------------------------------------------------- |
---|
[9169] | 13 | USE oce ! ocean dynamics and tracers variables |
---|
[15548] | 14 | USE c1d ! 1D configuration: ln_c1d |
---|
[9169] | 15 | USE dom_oce ! ocean domain: variables |
---|
| 16 | USE zdf_oce ! ocean vertical physics: variables |
---|
| 17 | USE sbc_oce ! surface module: variables |
---|
| 18 | USE phycst ! physical constants |
---|
| 19 | USE eosbn2 ! equation of state - Brunt Vaisala frequency |
---|
| 20 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
| 21 | USE zpshde ! z-coord. with partial steps: horizontal derivatives |
---|
| 22 | USE closea ! for ln_closea |
---|
[14030] | 23 | USE icb_oce ! for icebergs |
---|
[9124] | 24 | ! |
---|
[9169] | 25 | USE in_out_manager ! I/O manager |
---|
| 26 | USE iom ! I/O library |
---|
| 27 | USE lib_mpp ! distributed memory computing library |
---|
| 28 | USE prtctl ! print control |
---|
[12615] | 29 | USE fldread ! read input fields |
---|
[9169] | 30 | USE timing ! Timing |
---|
[3362] | 31 | |
---|
| 32 | IMPLICIT NONE |
---|
| 33 | PRIVATE |
---|
| 34 | |
---|
[3364] | 35 | PUBLIC sbc_ssm_init ! called by sbc_init |
---|
| 36 | PUBLIC sbc_ssm ! called by sbc |
---|
[3362] | 37 | |
---|
[9169] | 38 | CHARACTER(len=100) :: cn_dir ! Root directory for location of ssm files |
---|
| 39 | LOGICAL :: ln_3d_uve ! specify whether input velocity data is 3D |
---|
| 40 | LOGICAL :: ln_read_frq ! specify whether we must read frq or not |
---|
[12615] | 41 | |
---|
[9169] | 42 | LOGICAL :: l_sasread ! Ice intilisation: =T read a file ; =F anaytical initilaistion |
---|
| 43 | LOGICAL :: l_initdone = .false. |
---|
[5407] | 44 | INTEGER :: nfld_3d |
---|
| 45 | INTEGER :: nfld_2d |
---|
[3362] | 46 | |
---|
[5407] | 47 | INTEGER :: jf_tem ! index of temperature |
---|
| 48 | INTEGER :: jf_sal ! index of salinity |
---|
| 49 | INTEGER :: jf_usp ! index of u velocity component |
---|
| 50 | INTEGER :: jf_vsp ! index of v velocity component |
---|
| 51 | INTEGER :: jf_ssh ! index of sea surface height |
---|
| 52 | INTEGER :: jf_e3t ! index of first T level thickness |
---|
| 53 | INTEGER :: jf_frq ! index of fraction of qsr absorbed in the 1st T level |
---|
[3362] | 54 | |
---|
| 55 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_ssm_3d ! structure of input fields (file information, fields read) |
---|
| 56 | TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_ssm_2d ! structure of input fields (file information, fields read) |
---|
| 57 | |
---|
| 58 | !!---------------------------------------------------------------------- |
---|
[10068] | 59 | !! NEMO/SAS 4.0 , NEMO Consortium (2018) |
---|
[5215] | 60 | !! $Id$ |
---|
[10068] | 61 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[3362] | 62 | !!---------------------------------------------------------------------- |
---|
| 63 | CONTAINS |
---|
| 64 | |
---|
[12377] | 65 | SUBROUTINE sbc_ssm( kt, Kbb, Kmm ) |
---|
[3362] | 66 | !!---------------------------------------------------------------------- |
---|
| 67 | !! *** ROUTINE sbc_ssm *** |
---|
| 68 | !! |
---|
| 69 | !! ** Purpose : Prepares dynamics and physics fields from a NEMO run |
---|
| 70 | !! for an off-line simulation using surface processes only |
---|
| 71 | !! |
---|
[12615] | 72 | !! ** Method : calculates the position of data |
---|
[3362] | 73 | !! - interpolates data if needed |
---|
| 74 | !!---------------------------------------------------------------------- |
---|
| 75 | INTEGER, INTENT(in) :: kt ! ocean time-step index |
---|
[12377] | 76 | INTEGER, INTENT(in) :: Kbb, Kmm ! ocean time level indices |
---|
[12615] | 77 | ! (not needed for SAS but needed to keep a consistent interface in sbcmod.F90) |
---|
[3362] | 78 | ! |
---|
| 79 | INTEGER :: ji, jj ! dummy loop indices |
---|
| 80 | REAL(wp) :: ztinta ! ratio applied to after records when doing time interpolation |
---|
| 81 | REAL(wp) :: ztintb ! ratio applied to before records when doing time interpolation |
---|
| 82 | !!---------------------------------------------------------------------- |
---|
| 83 | ! |
---|
[9124] | 84 | IF( ln_timing ) CALL timing_start( 'sbc_ssm') |
---|
[12615] | 85 | |
---|
[7646] | 86 | IF ( l_sasread ) THEN |
---|
| 87 | IF( nfld_3d > 0 ) CALL fld_read( kt, 1, sf_ssm_3d ) !== read data at kt time step ==! |
---|
| 88 | IF( nfld_2d > 0 ) CALL fld_read( kt, 1, sf_ssm_2d ) !== read data at kt time step ==! |
---|
[12615] | 89 | ! |
---|
[7646] | 90 | IF( ln_3d_uve ) THEN |
---|
[7761] | 91 | IF( .NOT. ln_linssh ) THEN |
---|
[12615] | 92 | e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! vertical scale factor |
---|
[7761] | 93 | ELSE |
---|
| 94 | e3t_m(:,:) = e3t_0(:,:,1) ! vertical scale factor |
---|
| 95 | ENDIF |
---|
| 96 | ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1) ! u-velocity |
---|
[12615] | 97 | ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1) ! v-velocity |
---|
[7646] | 98 | ELSE |
---|
[7761] | 99 | IF( .NOT. ln_linssh ) THEN |
---|
[12615] | 100 | e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! vertical scale factor |
---|
[7761] | 101 | ELSE |
---|
| 102 | e3t_m(:,:) = e3t_0(:,:,1) ! vertical scale factor |
---|
| 103 | ENDIF |
---|
[14510] | 104 | IF( TRIM(sf_ssm_2d(jf_usp)%clrootname) == 'NOT USED' ) & |
---|
| 105 | & sf_ssm_2d(jf_usp)%fnow(:,:,1) = 0._wp |
---|
| 106 | IF( TRIM(sf_ssm_2d(jf_vsp)%clrootname) == 'NOT USED' ) & |
---|
| 107 | & sf_ssm_2d(jf_vsp)%fnow(:,:,1) = 0._wp |
---|
[7761] | 108 | ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1) ! u-velocity |
---|
[12615] | 109 | ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1) ! v-velocity |
---|
[7646] | 110 | ENDIF |
---|
| 111 | ! |
---|
[14510] | 112 | IF( TRIM(sf_ssm_2d(jf_sal)%clrootname) == 'NOT USED' ) & |
---|
| 113 | & sf_ssm_2d(jf_sal)%fnow(:,:,1) = 35._wp |
---|
| 114 | IF( TRIM(sf_ssm_2d(jf_tem)%clrootname) == 'NOT USED' ) & |
---|
| 115 | & CALL eos_fzp( sf_ssm_2d(jf_sal)%fnow(:,:,1), sf_ssm_2d(jf_tem)%fnow(:,:,1) ) |
---|
| 116 | IF( TRIM(sf_ssm_2d(jf_ssh)%clrootname) == 'NOT USED' ) & |
---|
| 117 | & sf_ssm_2d(jf_ssh)%fnow(:,:,1) = 0._wp |
---|
[7646] | 118 | sst_m(:,:) = sf_ssm_2d(jf_tem)%fnow(:,:,1) * tmask(:,:,1) ! temperature |
---|
| 119 | sss_m(:,:) = sf_ssm_2d(jf_sal)%fnow(:,:,1) * tmask(:,:,1) ! salinity |
---|
| 120 | ssh_m(:,:) = sf_ssm_2d(jf_ssh)%fnow(:,:,1) * tmask(:,:,1) ! sea surface height |
---|
| 121 | IF( ln_read_frq ) THEN |
---|
| 122 | frq_m(:,:) = sf_ssm_2d(jf_frq)%fnow(:,:,1) * tmask(:,:,1) ! solar penetration |
---|
| 123 | ELSE |
---|
| 124 | frq_m(:,:) = 1._wp |
---|
| 125 | ENDIF |
---|
[3362] | 126 | ELSE |
---|
[9019] | 127 | sss_m(:,:) = 35._wp ! =35. to obtain a physical value for the freezing point |
---|
| 128 | CALL eos_fzp( sss_m(:,:), sst_m(:,:) ) ! sst_m is set at the freezing point |
---|
[7646] | 129 | ssu_m(:,:) = 0._wp |
---|
| 130 | ssv_m(:,:) = 0._wp |
---|
| 131 | ssh_m(:,:) = 0._wp |
---|
[7761] | 132 | IF( .NOT. ln_linssh ) e3t_m(:,:) = e3t_0(:,:,1) !clem: necessary at least for sas2D |
---|
| 133 | frq_m(:,:) = 1._wp ! - - |
---|
[12377] | 134 | ssh (:,:,Kmm) = 0._wp ! - - |
---|
[3362] | 135 | ENDIF |
---|
[12615] | 136 | |
---|
[4147] | 137 | IF ( nn_ice == 1 ) THEN |
---|
[12377] | 138 | ts(:,:,1,jp_tem,Kmm) = sst_m(:,:) |
---|
| 139 | ts(:,:,1,jp_sal,Kmm) = sss_m(:,:) |
---|
| 140 | ts(:,:,1,jp_tem,Kbb) = sst_m(:,:) |
---|
| 141 | ts(:,:,1,jp_sal,Kbb) = sss_m(:,:) |
---|
[4147] | 142 | ENDIF |
---|
[12377] | 143 | uu (:,:,1,Kbb) = ssu_m(:,:) |
---|
| 144 | vv (:,:,1,Kbb) = ssv_m(:,:) |
---|
[12615] | 145 | |
---|
[12377] | 146 | IF(sn_cfctl%l_prtctl) THEN ! print control |
---|
[9440] | 147 | CALL prt_ctl(tab2d_1=sst_m, clinfo1=' sst_m - : ', mask1=tmask ) |
---|
| 148 | CALL prt_ctl(tab2d_1=sss_m, clinfo1=' sss_m - : ', mask1=tmask ) |
---|
| 149 | CALL prt_ctl(tab2d_1=ssu_m, clinfo1=' ssu_m - : ', mask1=umask ) |
---|
| 150 | CALL prt_ctl(tab2d_1=ssv_m, clinfo1=' ssv_m - : ', mask1=vmask ) |
---|
| 151 | CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' ssh_m - : ', mask1=tmask ) |
---|
| 152 | IF( .NOT.ln_linssh ) CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' e3t_m - : ', mask1=tmask ) |
---|
| 153 | IF( ln_read_frq ) CALL prt_ctl(tab2d_1=frq_m, clinfo1=' frq_m - : ', mask1=tmask ) |
---|
[3362] | 154 | ENDIF |
---|
| 155 | ! |
---|
[5407] | 156 | IF( l_initdone ) THEN ! Mean value at each nn_fsbc time-step ! |
---|
| 157 | CALL iom_put( 'ssu_m', ssu_m ) |
---|
| 158 | CALL iom_put( 'ssv_m', ssv_m ) |
---|
| 159 | CALL iom_put( 'sst_m', sst_m ) |
---|
| 160 | CALL iom_put( 'sss_m', sss_m ) |
---|
| 161 | CALL iom_put( 'ssh_m', ssh_m ) |
---|
[6140] | 162 | IF( .NOT.ln_linssh ) CALL iom_put( 'e3t_m', e3t_m ) |
---|
| 163 | IF( ln_read_frq ) CALL iom_put( 'frq_m', frq_m ) |
---|
[5407] | 164 | ENDIF |
---|
| 165 | ! |
---|
[9124] | 166 | IF( ln_timing ) CALL timing_stop( 'sbc_ssm') |
---|
[3362] | 167 | ! |
---|
| 168 | END SUBROUTINE sbc_ssm |
---|
| 169 | |
---|
| 170 | |
---|
[12377] | 171 | SUBROUTINE sbc_ssm_init( Kbb, Kmm ) |
---|
[3362] | 172 | !!---------------------------------------------------------------------- |
---|
| 173 | !! *** ROUTINE sbc_ssm_init *** |
---|
| 174 | !! |
---|
[12615] | 175 | !! ** Purpose : Initialisation of sea surface mean data |
---|
[3362] | 176 | !!---------------------------------------------------------------------- |
---|
[12615] | 177 | INTEGER, INTENT(in) :: Kbb, Kmm ! ocean time level indices |
---|
| 178 | ! (not needed for SAS but needed to keep a consistent interface in sbcmod.F90) |
---|
[3362] | 179 | INTEGER :: ierr, ierr0, ierr1, ierr2, ierr3 ! return error code |
---|
| 180 | INTEGER :: ifpr ! dummy loop indice |
---|
| 181 | INTEGER :: inum, idv, idimv, jpm ! local integer |
---|
[4147] | 182 | INTEGER :: ios ! Local integer output status for namelist read |
---|
[3362] | 183 | !! |
---|
[3364] | 184 | CHARACTER(len=100) :: cn_dir ! Root directory for location of core files |
---|
| 185 | TYPE(FLD_N), ALLOCATABLE, DIMENSION(:) :: slf_3d ! array of namelist information on the fields to read |
---|
| 186 | TYPE(FLD_N), ALLOCATABLE, DIMENSION(:) :: slf_2d ! array of namelist information on the fields to read |
---|
[9169] | 187 | TYPE(FLD_N) :: sn_tem, sn_sal ! information about the fields to be read |
---|
| 188 | TYPE(FLD_N) :: sn_usp, sn_vsp |
---|
| 189 | TYPE(FLD_N) :: sn_ssh, sn_e3t, sn_frq |
---|
| 190 | !! |
---|
[14072] | 191 | TYPE(FLD_N) :: sn_ifr, sn_tic, sn_ial |
---|
| 192 | !! |
---|
[9169] | 193 | NAMELIST/namsbc_sas/ l_sasread, cn_dir, ln_3d_uve, ln_read_frq, & |
---|
[14072] | 194 | & sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh, sn_e3t, sn_frq, & |
---|
| 195 | & sn_ifr, sn_tic, sn_ial |
---|
[9169] | 196 | !!---------------------------------------------------------------------- |
---|
[3362] | 197 | ! |
---|
[9169] | 198 | IF( ln_rstart .AND. nn_components == jp_iam_sas ) RETURN |
---|
| 199 | ! |
---|
| 200 | IF(lwp) THEN |
---|
| 201 | WRITE(numout,*) |
---|
| 202 | WRITE(numout,*) 'sbc_ssm_init : sea surface mean data initialisation ' |
---|
| 203 | WRITE(numout,*) '~~~~~~~~~~~~ ' |
---|
| 204 | ENDIF |
---|
| 205 | ! |
---|
[4147] | 206 | READ ( numnam_ref, namsbc_sas, IOSTAT = ios, ERR = 901) |
---|
[11536] | 207 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namsbc_sas in reference namelist' ) |
---|
[4147] | 208 | READ ( numnam_cfg, namsbc_sas, IOSTAT = ios, ERR = 902 ) |
---|
[11536] | 209 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namsbc_sas in configuration namelist' ) |
---|
[4624] | 210 | IF(lwm) WRITE ( numond, namsbc_sas ) |
---|
[12615] | 211 | ! |
---|
[9169] | 212 | IF(lwp) THEN ! Control print |
---|
[4147] | 213 | WRITE(numout,*) ' Namelist namsbc_sas' |
---|
[12615] | 214 | WRITE(numout,*) ' Initialisation using an input file l_sasread = ', l_sasread |
---|
[5407] | 215 | WRITE(numout,*) ' Are we supplying a 3D u,v and e3 field ln_3d_uve = ', ln_3d_uve |
---|
| 216 | WRITE(numout,*) ' Are we reading frq (fraction of qsr absorbed in the 1st T level) ln_read_frq = ', ln_read_frq |
---|
[3362] | 217 | ENDIF |
---|
[3364] | 218 | ! |
---|
| 219 | !! switch off stuff that isn't sensible with a standalone module |
---|
| 220 | !! note that we need sbc_ssm called first in sbc |
---|
| 221 | ! |
---|
| 222 | IF( ln_apr_dyn ) THEN |
---|
[9169] | 223 | IF( lwp ) WRITE(numout,*) ' ==>>> No atmospheric gradient needed with StandAlone Surface scheme' |
---|
[3364] | 224 | ln_apr_dyn = .FALSE. |
---|
| 225 | ENDIF |
---|
| 226 | IF( ln_rnf ) THEN |
---|
[9169] | 227 | IF( lwp ) WRITE(numout,*) ' ==>>> No runoff needed with StandAlone Surface scheme' |
---|
[3364] | 228 | ln_rnf = .FALSE. |
---|
| 229 | ENDIF |
---|
| 230 | IF( ln_ssr ) THEN |
---|
[9169] | 231 | IF( lwp ) WRITE(numout,*) ' ==>>> No surface relaxation needed with StandAlone Surface scheme' |
---|
[3364] | 232 | ln_ssr = .FALSE. |
---|
| 233 | ENDIF |
---|
| 234 | IF( nn_fwb > 0 ) THEN |
---|
[9169] | 235 | IF( lwp ) WRITE(numout,*) ' ==>>> No freshwater budget adjustment needed with StandAlone Surface scheme' |
---|
[3364] | 236 | nn_fwb = 0 |
---|
| 237 | ENDIF |
---|
[9161] | 238 | IF( ln_closea ) THEN |
---|
[9169] | 239 | IF( lwp ) WRITE(numout,*) ' ==>>> No closed seas adjustment needed with StandAlone Surface scheme' |
---|
[9161] | 240 | ln_closea = .false. |
---|
[3364] | 241 | ENDIF |
---|
[12615] | 242 | ! |
---|
[9169] | 243 | IF( l_sasread ) THEN ! store namelist information in an array |
---|
[12615] | 244 | ! |
---|
[9169] | 245 | !! following code is a bit messy, but distinguishes between when u,v are 3d arrays and |
---|
| 246 | !! when we have other 3d arrays that we need to read in |
---|
| 247 | !! so if a new field is added i.e. jf_new, just give it the next integer in sequence |
---|
| 248 | !! for the corresponding dimension (currently if ln_3d_uve is true, 4 for 2d and 3 for 3d, |
---|
| 249 | !! alternatively if ln_3d_uve is false, 6 for 2d and 1 for 3d), reset nfld_3d, nfld_2d, |
---|
| 250 | !! and the rest of the logic should still work |
---|
| 251 | ! |
---|
| 252 | jf_tem = 1 ; jf_ssh = 3 ! default 2D fields index |
---|
| 253 | jf_sal = 2 ; jf_frq = 4 ! |
---|
| 254 | ! |
---|
| 255 | IF( ln_3d_uve ) THEN |
---|
| 256 | jf_usp = 1 ; jf_vsp = 2 ; jf_e3t = 3 ! define 3D fields index |
---|
| 257 | nfld_3d = 2 + COUNT( (/.NOT.ln_linssh/) ) ! number of 3D fields to read |
---|
[9195] | 258 | nfld_2d = 3 + COUNT( (/ln_read_frq/) ) ! number of 2D fields to read |
---|
[9169] | 259 | ELSE |
---|
| 260 | jf_usp = 4 ; jf_e3t = 6 ! update 2D fields index |
---|
| 261 | jf_vsp = 5 ; jf_frq = 6 + COUNT( (/.NOT.ln_linssh/) ) |
---|
| 262 | ! |
---|
| 263 | nfld_3d = 0 ! no 3D fields to read |
---|
| 264 | nfld_2d = 5 + COUNT( (/.NOT.ln_linssh/) ) + COUNT( (/ln_read_frq/) ) ! number of 2D fields to read |
---|
[3364] | 265 | ENDIF |
---|
[9169] | 266 | ! |
---|
| 267 | IF( nfld_3d > 0 ) THEN |
---|
| 268 | ALLOCATE( slf_3d(nfld_3d), STAT=ierr ) ! set slf structure |
---|
| 269 | IF( ierr > 0 ) THEN |
---|
| 270 | CALL ctl_stop( 'sbc_ssm_init: unable to allocate slf 3d structure' ) ; RETURN |
---|
| 271 | ENDIF |
---|
| 272 | slf_3d(jf_usp) = sn_usp |
---|
| 273 | slf_3d(jf_vsp) = sn_vsp |
---|
| 274 | IF( .NOT.ln_linssh ) slf_3d(jf_e3t) = sn_e3t |
---|
[3364] | 275 | ENDIF |
---|
[9169] | 276 | ! |
---|
| 277 | IF( nfld_2d > 0 ) THEN |
---|
| 278 | ALLOCATE( slf_2d(nfld_2d), STAT=ierr ) ! set slf structure |
---|
| 279 | IF( ierr > 0 ) THEN |
---|
| 280 | CALL ctl_stop( 'sbc_ssm_init: unable to allocate slf 2d structure' ) ; RETURN |
---|
| 281 | ENDIF |
---|
| 282 | slf_2d(jf_tem) = sn_tem ; slf_2d(jf_sal) = sn_sal ; slf_2d(jf_ssh) = sn_ssh |
---|
| 283 | IF( ln_read_frq ) slf_2d(jf_frq) = sn_frq |
---|
| 284 | IF( .NOT. ln_3d_uve ) THEN |
---|
| 285 | slf_2d(jf_usp) = sn_usp ; slf_2d(jf_vsp) = sn_vsp |
---|
| 286 | IF( .NOT.ln_linssh ) slf_2d(jf_e3t) = sn_e3t |
---|
| 287 | ENDIF |
---|
[3364] | 288 | ENDIF |
---|
[9169] | 289 | ! |
---|
[12615] | 290 | ierr1 = 0 ! default definition if slf_?d(ifpr)%ln_tint = .false. |
---|
[9169] | 291 | IF( nfld_3d > 0 ) THEN |
---|
| 292 | ALLOCATE( sf_ssm_3d(nfld_3d), STAT=ierr ) ! set sf structure |
---|
| 293 | IF( ierr > 0 ) THEN |
---|
| 294 | CALL ctl_stop( 'sbc_ssm_init: unable to allocate sf structure' ) ; RETURN |
---|
| 295 | ENDIF |
---|
| 296 | DO ifpr = 1, nfld_3d |
---|
[12615] | 297 | ALLOCATE( sf_ssm_3d(ifpr)%fnow(jpi,jpj,jpk) , STAT=ierr0 ) |
---|
[9169] | 298 | IF( slf_3d(ifpr)%ln_tint ) ALLOCATE( sf_ssm_3d(ifpr)%fdta(jpi,jpj,jpk,2) , STAT=ierr1 ) |
---|
| 299 | IF( ierr0 + ierr1 > 0 ) THEN |
---|
| 300 | CALL ctl_stop( 'sbc_ssm_init : unable to allocate sf_ssm_3d array structure' ) ; RETURN |
---|
| 301 | ENDIF |
---|
| 302 | END DO |
---|
| 303 | ! ! fill sf with slf_i and control print |
---|
| 304 | CALL fld_fill( sf_ssm_3d, slf_3d, cn_dir, 'sbc_ssm_init', '3D Data in file', 'namsbc_ssm' ) |
---|
[13286] | 305 | sf_ssm_3d(jf_usp)%cltype = 'U' ; sf_ssm_3d(jf_usp)%zsgn = -1._wp |
---|
| 306 | sf_ssm_3d(jf_vsp)%cltype = 'V' ; sf_ssm_3d(jf_vsp)%zsgn = -1._wp |
---|
[3362] | 307 | ENDIF |
---|
[9169] | 308 | ! |
---|
| 309 | IF( nfld_2d > 0 ) THEN |
---|
| 310 | ALLOCATE( sf_ssm_2d(nfld_2d), STAT=ierr ) ! set sf structure |
---|
| 311 | IF( ierr > 0 ) THEN |
---|
| 312 | CALL ctl_stop( 'sbc_ssm_init: unable to allocate sf 2d structure' ) ; RETURN |
---|
[3362] | 313 | ENDIF |
---|
[9169] | 314 | DO ifpr = 1, nfld_2d |
---|
[12615] | 315 | ALLOCATE( sf_ssm_2d(ifpr)%fnow(jpi,jpj,1) , STAT=ierr0 ) |
---|
[9169] | 316 | IF( slf_2d(ifpr)%ln_tint ) ALLOCATE( sf_ssm_2d(ifpr)%fdta(jpi,jpj,1,2) , STAT=ierr1 ) |
---|
| 317 | IF( ierr0 + ierr1 > 0 ) THEN |
---|
| 318 | CALL ctl_stop( 'sbc_ssm_init : unable to allocate sf_ssm_2d array structure' ) ; RETURN |
---|
| 319 | ENDIF |
---|
| 320 | END DO |
---|
| 321 | ! |
---|
| 322 | CALL fld_fill( sf_ssm_2d, slf_2d, cn_dir, 'sbc_ssm_init', '2D Data in file', 'namsbc_ssm' ) |
---|
[13286] | 323 | IF( .NOT. ln_3d_uve ) THEN |
---|
| 324 | sf_ssm_2d(jf_usp)%cltype = 'U' ; sf_ssm_2d(jf_usp)%zsgn = -1._wp |
---|
| 325 | sf_ssm_2d(jf_vsp)%cltype = 'V' ; sf_ssm_2d(jf_vsp)%zsgn = -1._wp |
---|
| 326 | ENDIF |
---|
[3362] | 327 | ENDIF |
---|
| 328 | ! |
---|
[9169] | 329 | IF( nfld_3d > 0 ) DEALLOCATE( slf_3d, STAT=ierr ) |
---|
| 330 | IF( nfld_2d > 0 ) DEALLOCATE( slf_2d, STAT=ierr ) |
---|
| 331 | ! |
---|
[3362] | 332 | ENDIF |
---|
| 333 | ! |
---|
[12377] | 334 | CALL sbc_ssm( nit000, Kbb, Kmm ) ! need to define ss?_m arrays used in iceistate |
---|
[5407] | 335 | l_initdone = .TRUE. |
---|
[3364] | 336 | ! |
---|
| 337 | END SUBROUTINE sbc_ssm_init |
---|
| 338 | |
---|
[3362] | 339 | !!====================================================================== |
---|
| 340 | END MODULE sbcssm |
---|