- Timestamp:
- 2015-06-04T09:48:48+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5218_CNRS17_coupling/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90
r5331 r5343 36 36 PUBLIC sbc_ssm ! called by sbc 37 37 38 CHARACTER(len=100) :: cn_dir = './' !: Root directory for location of ssm files 39 LOGICAL :: ln_3d_uv = .true. !: specify whether input velocity data is 3D 40 INTEGER , SAVE :: nfld_3d 41 INTEGER , SAVE :: nfld_2d 42 43 INTEGER , PARAMETER :: jpfld_3d = 4 ! maximum number of files to read 44 INTEGER , PARAMETER :: jpfld_2d = 1 ! maximum number of files to read 45 INTEGER , SAVE :: jf_tem ! index of temperature 46 INTEGER , SAVE :: jf_sal ! index of salinity 47 INTEGER , SAVE :: jf_usp ! index of u velocity component 48 INTEGER , SAVE :: jf_vsp ! index of v velocity component 49 INTEGER , SAVE :: jf_ssh ! index of sea surface height 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 INTEGER :: nfld_3d 41 INTEGER :: nfld_2d 42 43 INTEGER :: jf_tem ! index of temperature 44 INTEGER :: jf_sal ! index of salinity 45 INTEGER :: jf_usp ! index of u velocity component 46 INTEGER :: jf_vsp ! index of v velocity component 47 INTEGER :: jf_ssh ! index of sea surface height 48 INTEGER :: jf_e3t ! index of first T level thickness 50 49 51 50 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_ssm_3d ! structure of input fields (file information, fields read) 52 51 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_ssm_2d ! structure of input fields (file information, fields read) 53 52 54 !! * Substitutions55 # include "domzgr_substitute.h90"56 # include "vectopt_loop_substitute.h90"57 53 !!---------------------------------------------------------------------- 58 54 !! NEMO/OFF 3.3 , NEMO Consortium (2010) … … 86 82 IF( nfld_2d > 0 ) CALL fld_read( kt, 1, sf_ssm_2d ) !== read data at kt time step ==! 87 83 ! 88 IF( ln_3d_uv ) THEN84 IF( ln_3d_uve ) THEN 89 85 ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1) ! u-velocity 90 86 ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1) ! v-velocity 87 IF( lk_vvl ) e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! v-velocity 91 88 ELSE 92 89 ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1) ! u-velocity 93 90 ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1) ! v-velocity 91 IF( lk_vvl ) e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! v-velocity 94 92 ENDIF 95 93 ! … … 104 102 tsb(:,:,1,jp_sal) = sss_m(:,:) 105 103 ENDIF 106 ub (:,:,1 107 vb (:,:,1 104 ub (:,:,1) = ssu_m(:,:) 105 vb (:,:,1) = ssv_m(:,:) 108 106 109 107 IF(ln_ctl) THEN ! print control … … 113 111 CALL prt_ctl(tab2d_1=ssv_m, clinfo1=' ssv_m - : ', mask1=vmask, ovlap=1 ) 114 112 CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' ssh_m - : ', mask1=tmask, ovlap=1 ) 113 IF( lk_vvl ) CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' e3t_m - : ', mask1=tmask, ovlap=1 ) 115 114 ENDIF 116 115 ! … … 138 137 TYPE(FLD_N), ALLOCATABLE, DIMENSION(:) :: slf_2d ! array of namelist information on the fields to read 139 138 TYPE(FLD_N) :: sn_tem, sn_sal ! information about the fields to be read 140 TYPE(FLD_N) :: sn_usp, sn_vsp, sn_ssh 141 ! 142 NAMELIST/namsbc_sas/cn_dir, ln_3d_uv, sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh 139 TYPE(FLD_N) :: sn_usp, sn_vsp 140 TYPE(FLD_N) :: sn_ssh, sn_e3t 141 ! 142 NAMELIST/namsbc_sas/cn_dir, ln_3d_uve, sn_tem, sn_sal, sn_usp, sn_vsp, sn_ssh, sn_e3t 143 143 !!---------------------------------------------------------------------- 144 144 … … 195 195 !! when we have other 3d arrays that we need to read in 196 196 !! so if a new field is added i.e. jf_new, just give it the next integer in sequence 197 !! for the corresponding dimension (currently if ln_3d_uv is true, 4 for 2d and 3 for 3d,198 !! alternatively if ln_3d_uv is false, 6 for 2d and 1 for 3d), reset nfld_3d, nfld_2d,197 !! for the corresponding dimension (currently if ln_3d_uve is true, 4 for 2d and 3 for 3d, 198 !! alternatively if ln_3d_uve is false, 6 for 2d and 1 for 3d), reset nfld_3d, nfld_2d, 199 199 !! and the rest of the logic should still work 200 200 ! 201 201 jf_tem = 1 ; jf_sal = 2 ; jf_ssh = 3 202 202 ! 203 IF( ln_3d_uv ) THEN204 jf_usp = 1 ; jf_vsp = 2 205 nfld_3d = 2 203 IF( ln_3d_uve ) THEN 204 jf_usp = 1 ; jf_vsp = 2 ; jf_e3t = 3 205 nfld_3d = 2 + COUNT( (/lk_vvl/) ) 206 206 nfld_2d = 3 207 207 ELSE 208 jf_usp = 4 ; jf_vsp = 5 208 jf_usp = 4 ; jf_vsp = 5 ; jf_e3t = 6 209 209 nfld_3d = 0 210 nfld_2d = 5 210 nfld_2d = 5 + COUNT( (/lk_vvl/) ) 211 211 ENDIF 212 212 … … 216 216 CALL ctl_stop( 'sbc_ssm_init: unable to allocate slf 3d structure' ) ; RETURN 217 217 ENDIF 218 IF( ln_3d_uv ) THEN 219 slf_3d(jf_usp) = sn_usp 220 slf_3d(jf_vsp) = sn_vsp 221 ENDIF 218 slf_3d(jf_usp) = sn_usp 219 slf_3d(jf_vsp) = sn_vsp 220 IF( lk_vvl ) slf_3d(jf_e3t) = sn_e3t 222 221 ENDIF 223 222 … … 228 227 ENDIF 229 228 slf_2d(jf_tem) = sn_tem ; slf_2d(jf_sal) = sn_sal ; slf_2d(jf_ssh) = sn_ssh 230 IF( .NOT. ln_3d_uv ) THEN229 IF( .NOT. ln_3d_uve ) THEN 231 230 slf_2d(jf_usp) = sn_usp ; slf_2d(jf_vsp) = sn_vsp 232 ENDIF 233 ENDIF 234 ! 231 IF( lk_vvl ) slf_2d(jf_e3t) = sn_e3t 232 ENDIF 233 ENDIF 234 ! 235 ierr1 = 0 ! default definition if slf_?d(ifpr)%ln_tint = .false. 235 236 IF( nfld_3d > 0 ) THEN 236 237 ALLOCATE( sf_ssm_3d(nfld_3d), STAT=ierr ) ! set sf structure … … 269 270 IF( nfld_3d > 0 ) DEALLOCATE( slf_3d, STAT=ierr ) 270 271 IF( nfld_2d > 0 ) DEALLOCATE( slf_2d, STAT=ierr ) 272 273 call sbc_ssm( nit000 ) ! need to define ss?_m arrays used in limistate 271 274 ! 272 275 END SUBROUTINE sbc_ssm_init
Note: See TracChangeset
for help on using the changeset viewer.