Changeset 5654 for branches/UKMO/2015_V36_STABLE_CO6_CO5_zenv_pomsdwl/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx.F90
- Timestamp:
- 2015-07-30T18:45:28+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/2015_V36_STABLE_CO6_CO5_zenv_pomsdwl/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx.F90
r5650 r5654 28 28 PUBLIC sbc_flx ! routine called by step.F90 29 29 30 INTEGER , PARAMETER :: jpfld = 5! maximum number of files to read30 INTEGER , PARAMETER :: jpfld = 6 ! maximum number of files to read 31 31 INTEGER , PARAMETER :: jp_utau = 1 ! index of wind stress (i-component) file 32 32 INTEGER , PARAMETER :: jp_vtau = 2 ! index of wind stress (j-component) file … … 34 34 INTEGER , PARAMETER :: jp_qsr = 4 ! index of solar heat file 35 35 INTEGER , PARAMETER :: jp_emp = 5 ! index of evaporation-precipation file 36 INTEGER , PARAMETER :: jp_press = 6 ! index of pressure for UKMO shelf fluxes 36 37 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf ! structure of input fields (file informations, fields read) 38 LOGICAL , PUBLIC :: ln_shelf_flx = .FALSE. ! UKMO SHELF specific flux flag 39 INTEGER :: jpfld_local ! maximum number of files to 40 read (locally modified depending on ln_shelf_flx) 37 41 38 42 !! * Substitutions … … 82 86 REAL(wp) :: zcdrag = 1.5e-3 ! drag coefficient 83 87 REAL(wp) :: ztx, zty, zmod, zcoef ! temporary variables 88 REAL :: cs ! UKMO SHELF: Friction co-efficient at surface 89 REAL :: totwindspd ! UKMO SHELF: Magnitude of wind speed vector 90 91 REAL(wp) :: rhoa = 1.22 ! Air density kg/m3 92 REAL(wp) :: cdrag = 1.5e-3 ! drag coefficient 84 93 !! 85 94 CHARACTER(len=100) :: cn_dir ! Root directory for location of flx files 86 95 TYPE(FLD_N), DIMENSION(jpfld) :: slf_i ! array of namelist information structures 87 TYPE(FLD_N) :: sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp ! informations about the fields to be read 88 NAMELIST/namsbc_flx/ cn_dir, sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp 96 TYPE(FLD_N) :: sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp, sn_press ! informations about the fields to be read 97 LOGICAL :: ln_foam_flx = .FALSE. ! UKMO FOAM specific flux flag 98 NAMELIST/namsbc_flx/ cn_dir, sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp, & 99 & ln_foam_flx, sn_press, ln_shelf_flx 89 100 !!--------------------------------------------------------------------- 90 101 ! … … 109 120 slf_i(jp_emp ) = sn_emp 110 121 ! 111 ALLOCATE( sf(jpfld), STAT=ierror ) ! set sf structure 122 ALLOCATE( sf(jpfld), STAT=ierror ) ! set sf structure 123 IF( ln_shelf_flx ) slf_i(jp_press) = sn_press 124 125 ! define local jpfld depending on shelf_flx logical 126 IF( ln_shelf_flx ) THEN 127 jpfld_local = jpfld 128 ELSE 129 jpfld_local = jpfld-1 130 ENDIF 131 ! 132 ALLOCATE( sf(jpfld_local), STAT=ierror ) ! set sf structure 112 133 IF( ierror > 0 ) THEN 113 134 CALL ctl_stop( 'sbc_flx: unable to allocate sf structure' ) ; RETURN … … 132 153 ENDIF 133 154 !CDIR COLLAPSE 155 !!UKMO SHELF effect of atmospheric pressure on SSH 156 ! If using ln_apr_dyn, this is done there so don't repeat here. 157 IF( ln_shelf_flx .AND. .NOT. ln_apr_dyn) THEN 158 DO jj = 1, jpjm1 159 DO ji = 1, jpim1 160 apgu(ji,jj) = (-1.0/rau0)*(sf(jp_press)%fnow(ji+1,jj,1)-sf(jp_press)%fnow(ji,jj,1))/e1u(ji,jj) 161 apgv(ji,jj) = (-1.0/rau0)*(sf(jp_press)%fnow(ji,jj+1,1)-sf(jp_press)%fnow(ji,jj,1))/e2v(ji,jj) 162 END DO 163 END DO 164 ENDIF ! ln_shelf_flx 165 134 166 DO jj = 1, jpj ! set the ocean fluxes from read fields 135 167 DO ji = 1, jpi 136 utau(ji,jj) = sf(jp_utau)%fnow(ji,jj,1) 137 vtau(ji,jj) = sf(jp_vtau)%fnow(ji,jj,1) 138 qns (ji,jj) = sf(jp_qtot)%fnow(ji,jj,1) - sf(jp_qsr)%fnow(ji,jj,1) 139 emp (ji,jj) = sf(jp_emp )%fnow(ji,jj,1) 168 IF( ln_shelf_flx ) THEN 169 !! UKMO SHELF - need atmospheric pressure to calculate Haney forcing 170 pressnow(ji,jj) = sf(jp_press)%fnow(ji,jj,1) 171 !! UKMO SHELF flux files contain wind speed not wind stress 172 totwindspd = sqrt((sf(jp_utau)%fnow(ji,jj,1))**2.0 + (sf(jp_vtau)%fnow(ji,jj,1))**2.0) 173 cs = 0.63 + (0.066 * totwindspd) 174 utau(ji,jj) = cs * (rhoa/rau0) * sf(jp_utau)%fnow(ji,jj,1) * totwindspd 175 vtau(ji,jj) = cs * (rhoa/rau0) * sf(jp_vtau)%fnow(ji,jj,1) * totwindspd 176 ELSE 177 utau(ji,jj) = sf(jp_utau)%fnow(ji,jj,1) 178 vtau(ji,jj) = sf(jp_vtau)%fnow(ji,jj,1) 179 ENDIF 180 qsr (ji,jj) = sf(jp_qsr )%fnow(ji,jj,1) 181 IF( ln_foam_flx .OR. ln_shelf_flx ) THEN 182 !! UKMO FOAM flux files contain non-solar heat flux (qns) rather than total heat flux (qtot) 183 qns (ji,jj) = sf(jp_qtot)%fnow(ji,jj,1) 184 !! UKMO FOAM flux files contain the net DOWNWARD freshwater flux P-E rather then E-P 185 emp (ji,jj) = -1. * sf(jp_emp )%fnow(ji,jj,1) 186 ELSE 187 qns (ji,jj) = sf(jp_qtot)%fnow(ji,jj,1) - sf(jp_qsr)%fnow(ji,jj,1) 188 emp (ji,jj) = sf(jp_emp )%fnow(ji,jj,1) 189 ENDIF 140 190 END DO 141 191 END DO … … 143 193 qns(:,:) = qns(:,:) - emp(:,:) * sst_m(:,:) * rcp ! mass flux is at SST 144 194 ! 195 196 !! UKMO FOAM wind fluxes need lbc_lnk calls owing to a bug in interp.exe 197 IF( ln_foam_flx ) THEN 198 CALL lbc_lnk( utau(:,:), 'U', -1. ) 199 CALL lbc_lnk( vtau(:,:), 'V', -1. ) 200 ENDIF 201 145 202 ! ! module of wind stress and wind speed at T-point 146 203 zcoef = 1. / ( zrhoa * zcdrag ) … … 162 219 WRITE(numout,*) 163 220 WRITE(numout,*) ' read daily momentum, heat and freshwater fluxes OK' 164 DO jf = 1, jpfld 221 DO jf = 1, jpfld_local 165 222 IF( jf == jp_utau .OR. jf == jp_vtau ) zfact = 1. 166 223 IF( jf == jp_qtot .OR. jf == jp_qsr ) zfact = 0.1
Note: See TracChangeset
for help on using the changeset viewer.