Changeset 15310
- Timestamp:
- 2021-10-01T13:36:55+02:00 (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/UKMO/NEMO_4.0.4_CO9_shelf_climate/src/OCE/SBC/sbcflx.F90
r14075 r15310 35 35 INTEGER , PARAMETER :: jp_emp = 5 ! index of evaporation-precipation file 36 36 !!INTEGER , PARAMETER :: jp_sfx = 6 ! index of salt flux flux 37 INTEGER , PARAMETER :: jpfld = 5 !! 6 ! maximum number of files to read 37 INTEGER , PARAMETER :: jp_press = 6 ! index of pressure for UKMO shelf fluxes 38 INTEGER , PARAMETER :: jpfld = 6 !! 6 ! maximum number of files to read 38 39 39 40 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf ! structure of input fields (file informations, fields read) 41 ! JT 42 LOGICAL , PUBLIC :: ln_shelf_flx = .TRUE. ! UKMO SHELF specific flux flag 43 INTEGER :: jpfld_local ! maximum number of files to read (locally modified depending on ln_shelf_flx) 44 ! JT 45 40 46 41 47 !! * Substitutions … … 85 91 REAL(wp) :: zcdrag = 1.5e-3 ! drag coefficient 86 92 REAL(wp) :: ztx, zty, zmod, zcoef ! temporary variables 93 ! JT 94 REAL :: cs ! UKMO SHELF: Friction co-efficient at surface 95 REAL :: totwindspd ! UKMO SHELF: Magnitude of wind speed vector 96 97 REAL(wp) :: rhoa = 1.22 ! Air density kg/m3 98 REAL(wp) :: cdrag = 1.5e-3 ! drag coefficient 99 ! JT 87 100 !! 88 101 CHARACTER(len=100) :: cn_dir ! Root directory for location of flx files 89 102 TYPE(FLD_N), DIMENSION(jpfld) :: slf_i ! array of namelist information structures 90 TYPE(FLD_N) :: sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp !!, sn_sfx ! informations about the fields to be read 91 NAMELIST/namsbc_flx/ cn_dir, sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp !!, sn_sfx 103 ! JT 104 TYPE(FLD_N) :: sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp, sn_press !!, sn_sfx ! informations about the fields to be read 105 NAMELIST/namsbc_flx/ cn_dir, sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp, & 106 & sn_press, ln_shelf_flx 107 ! JT 108 92 109 !!--------------------------------------------------------------------- 93 110 ! … … 102 119 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namsbc_flx in configuration namelist' ) 103 120 IF(lwm) WRITE ( numond, namsbc_flx ) 121 122 104 123 ! 105 124 ! ! check: do we plan to use ln_dm2dc with non-daily forcing? … … 112 131 slf_i(jp_emp ) = sn_emp !! ; slf_i(jp_sfx ) = sn_sfx 113 132 ! 114 ALLOCATE( sf(jpfld), STAT=ierror ) ! set sf structure 133 ALLOCATE( sf(jpfld), STAT=ierror ) ! set sf structure 134 IF( ln_shelf_flx ) slf_i(jp_press) = sn_press 135 136 ! define local jpfld depending on shelf_flx logical 137 IF( ln_shelf_flx ) THEN 138 jpfld_local = jpfld 139 ELSE 140 jpfld_local = jpfld-1 141 ENDIF 142 ! 115 143 IF( ierror > 0 ) THEN 116 144 CALL ctl_stop( 'sbc_flx: unable to allocate sf structure' ) ; RETURN 117 145 ENDIF 118 DO ji= 1, jpfld 146 DO ji= 1, jpfld_local 119 147 ALLOCATE( sf(ji)%fnow(jpi,jpj,1) ) 120 148 IF( slf_i(ji)%ln_tint ) ALLOCATE( sf(ji)%fdta(jpi,jpj,1,2) ) … … 123 151 CALL fld_fill( sf, slf_i, cn_dir, 'sbc_flx', 'flux formulation for ocean surface boundary condition', 'namsbc_flx' ) 124 152 ! 153 sfx(:,:) = 0.0_wp ! salt flux due to freezing/melting (non-zero only if ice is present; set in limsbc(_2).F90) 154 ! 125 155 ENDIF 126 156 … … 132 162 ELSE ; qsr(:,:) = sf(jp_qsr)%fnow(:,:,1) * tmask(:,:,1) 133 163 ENDIF 164 165 !!UKMO SHELF effect of atmospheric pressure on SSH 166 ! If using ln_apr_dyn, this is done there so don't repeat here. 167 !IF( ln_shelf_flx .AND. .NOT. ln_apr_dyn) THEN 168 ! DO jj = 1, jpjm1 169 ! DO ji = 1, jpim1 170 ! apgu(ji,jj) = (-1.0/rau0)*(sf(jp_press)%fnow(ji+1,jj,1)-sf(jp_press)%fnow(ji,jj,1))/e1u(ji,jj) 171 ! apgv(ji,jj) = (-1.0/rau0)*(sf(jp_press)%fnow(ji,jj+1,1)-sf(jp_press)%fnow(ji,jj,1))/e2v(ji,jj) 172 ! END DO 173 ! END DO 174 !ENDIF 175 134 176 DO jj = 1, jpj ! set the ocean fluxes from read fields 135 177 DO ji = 1, jpi 136 utau(ji,jj) = sf(jp_utau)%fnow(ji,jj,1) * umask(ji,jj,1) 137 vtau(ji,jj) = sf(jp_vtau)%fnow(ji,jj,1) * vmask(ji,jj,1) 138 qns (ji,jj) = ( sf(jp_qtot)%fnow(ji,jj,1) - sf(jp_qsr)%fnow(ji,jj,1) ) * tmask(ji,jj,1) 178 !JT 179 IF( ln_shelf_flx ) THEN 180 !! UKMO SHELF - need atmospheric pressure to calculate Haney forcing 181 pressnow(ji,jj) = sf(jp_press)%fnow(ji,jj,1) 182 !! UKMO SHELF flux files contain wind speed not wind stress 183 totwindspd = sqrt((sf(jp_utau)%fnow(ji,jj,1))**2.0 + (sf(jp_vtau)%fnow(ji,jj,1))**2.0) 184 cs = 0.63 + (0.066 * totwindspd) 185 utau(ji,jj) = (cs * (rhoa/rau0) * sf(jp_utau)%fnow(ji,jj,1) * totwindspd)* umask(ji,jj,1) 186 vtau(ji,jj) = (cs * (rhoa/rau0) * sf(jp_vtau)%fnow(ji,jj,1) * totwindspd)* vmask(ji,jj,1) 187 ELSE 188 utau(ji,jj) = sf(jp_utau)%fnow(ji,jj,1)* umask(ji,jj,1) 189 vtau(ji,jj) = sf(jp_vtau)%fnow(ji,jj,1)* vmask(ji,jj,1) 190 ENDIF 191 !JT 192 qsr (ji,jj) = sf(jp_qsr )%fnow(ji,jj,1) * tmask(ji,jj,1) 193 !utau(ji,jj) = sf(jp_utau)%fnow(ji,jj,1) * umask(ji,jj,1) 194 !vtau(ji,jj) = sf(jp_vtau)%fnow(ji,jj,1) * vmask(ji,jj,1) 195 !JT qns (ji,jj) = ( sf(jp_qtot)%fnow(ji,jj,1) - sf(jp_qsr)%fnow(ji,jj,1) ) * tmask(ji,jj,1) 196 qns (ji,jj) = ( sf(jp_qtot)%fnow(ji,jj,1) - qsr (ji,jj) ) * tmask(ji,jj,1) 139 197 emp (ji,jj) = sf(jp_emp )%fnow(ji,jj,1) * tmask(ji,jj,1) 140 198 !!sfx (ji,jj) = sf(jp_sfx )%fnow(ji,jj,1) * tmask(ji,jj,1) … … 146 204 ! 147 205 ! clem: without these lbc calls, it seems that the northfold is not ok (true in 3.6, not sure in 4.x) 206 207 !JT Enabling as used in previous version using these climate forcings 208 qns(:,:) = qns(:,:) - emp(:,:) * sst_m(:,:) * rcp ! mass flux is at SST 209 !JT 210 148 211 CALL lbc_lnk_multi( 'sbcflx', utau, 'U', -1._wp, vtau, 'V', -1._wp, & 149 212 & qns, 'T', 1._wp, emp , 'T', 1._wp, qsr, 'T', 1._wp ) !! sfx, 'T', 1._wp ) … … 152 215 WRITE(numout,*) 153 216 WRITE(numout,*) ' read daily momentum, heat and freshwater fluxes OK' 154 DO jf = 1, jpfld 217 DO jf = 1, jpfld_local 155 218 IF( jf == jp_utau .OR. jf == jp_vtau ) zfact = 1. 156 219 IF( jf == jp_qtot .OR. jf == jp_qsr ) zfact = 0.1
Note: See TracChangeset
for help on using the changeset viewer.