Changeset 14789 for NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/SBC/sbcfwb.F90
- Timestamp:
- 2021-05-05T13:18:04+02:00 (3 years ago)
- Location:
- NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU
- Property svn:externals
-
old new 3 3 ^/utils/build/mk@HEAD mk 4 4 ^/utils/tools@HEAD tools 5 ^/vendors/AGRIF/dev _r12970_AGRIF_CMEMSext/AGRIF5 ^/vendors/AGRIF/dev@HEAD ext/AGRIF 6 6 ^/vendors/FCM@HEAD ext/FCM 7 7 ^/vendors/IOIPSL@HEAD ext/IOIPSL 8 ^/vendors/PPR@HEAD ext/PPR 8 9 9 10 # SETTE 10 ^/utils/CI/sette@1 3559sette11 ^/utils/CI/sette@14244 sette
-
- Property svn:externals
-
NEMO/branches/2021/dev_r13747_HPC-11_mcastril_HPDAonline_DiagGPU/src/OCE/SBC/sbcfwb.F90
r13582 r14789 24 24 ! 25 25 USE in_out_manager ! I/O manager 26 USE iom ! IOM 26 27 USE lib_mpp ! distribued memory computing library 27 28 USE timing ! Timing … … 34 35 PUBLIC sbc_fwb ! routine called by step 35 36 36 REAL(wp) :: a_fwb_b ! annual domain averaged freshwater budget37 REAL(wp) :: a_fwb ! for 2 year before (_b) and before year.38 REAL(wp) :: fwfold ! fwfold to be suppressed37 REAL(wp) :: rn_fwb0 ! initial freshwater adjustment flux [kg/m2/s] (nn_fwb = 2 only) 38 REAL(wp) :: a_fwb ! annual domain averaged freshwater budget from the 39 ! previous year 39 40 REAL(wp) :: area ! global mean ocean surface (interior domain) 40 41 … … 65 66 INTEGER, INTENT( in ) :: Kmm ! ocean time level index 66 67 ! 67 INTEGER :: i num, ikty, iyear! local integers68 INTEGER :: ios, inum, ikty ! local integers 68 69 REAL(wp) :: z_fwf, z_fwf_nsrf, zsum_fwf, zsum_erp ! local scalars 69 70 REAL(wp) :: zsurf_neg, zsurf_pos, zsurf_tospread, zcoef ! - - … … 72 73 REAL(wp) ,DIMENSION(1) :: z_fwfprv 73 74 COMPLEX(dp),DIMENSION(1) :: y_fwfnow 75 ! 76 NAMELIST/namsbc_fwb/rn_fwb0 74 77 !!---------------------------------------------------------------------- 75 78 ! 76 79 IF( kt == nit000 ) THEN 80 READ( numnam_ref, namsbc_fwb, IOSTAT = ios, ERR = 901 ) 81 901 IF( ios /= 0 ) CALL ctl_nam( ios, 'namsbc_fwb in reference namelist' ) 82 READ( numnam_cfg, namsbc_fwb, IOSTAT = ios, ERR = 902 ) 83 902 IF( ios > 0 ) CALL ctl_nam( ios, 'namsbc_fwb in configuration namelist' ) 84 IF(lwm) WRITE( numond, namsbc_fwb ) 77 85 IF(lwp) THEN 78 86 WRITE(numout,*) … … 80 88 WRITE(numout,*) '~~~~~~~' 81 89 IF( kn_fwb == 1 ) WRITE(numout,*) ' instantaneously set to zero' 82 IF( kn_fwb == 2 ) WRITE(numout,*) ' adjusted from previous year budget'83 90 IF( kn_fwb == 3 ) WRITE(numout,*) ' fwf set to zero and spread out over erp area' 91 IF( kn_fwb == 2 ) THEN 92 WRITE(numout,*) ' adjusted from previous year budget' 93 WRITE(numout,*) 94 WRITE(numout,*) ' Namelist namsbc_fwb' 95 WRITE(numout,*) ' Initial freshwater adjustment flux [kg/m2/s] = ', rn_fwb0 96 END IF 84 97 ENDIF 85 98 ! … … 110 123 emp(:,:) = emp(:,:) - z_fwfprv(1) * tmask(:,:,1) 111 124 qns(:,:) = qns(:,:) + zcoef * sst_m(:,:) * tmask(:,:,1) ! account for change to the heat budget due to fw correction 112 ENDIF 113 ! 114 CASE ( 2 ) !== fwf budget adjusted from the previous year ==! 115 ! 116 IF( kt == nit000 ) THEN ! initialisation 117 ! ! Read the corrective factor on precipitations (fwfold) 118 CALL ctl_opn( inum, 'EMPave_old.dat', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 119 READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb 120 CLOSE( inum ) 121 fwfold = a_fwb ! current year freshwater budget correction 122 ! ! estimate from the previous year budget 125 ! outputs 126 IF( iom_use('hflx_fwb_cea') ) CALL iom_put( 'hflx_fwb_cea', zcoef * sst_m(:,:) * tmask(:,:,1) ) 127 IF( iom_use('vflx_fwb_cea') ) CALL iom_put( 'vflx_fwb_cea', z_fwfprv(1) * tmask(:,:,1) ) 128 ENDIF 129 ! 130 CASE ( 2 ) !== fw adjustment based on fw budget at the end of the previous year ==! 131 ! 132 IF( kt == nit000 ) THEN ! initialisation 133 ! ! set the fw adjustment (a_fwb) 134 IF ( ln_rstart .AND. iom_varid( numror, 'a_fwb', ldstop = .FALSE. ) > 0 ) THEN ! as read from restart file 135 IF(lwp) WRITE(numout,*) 'sbc_fwb : reading FW-budget adjustment from restart file' 136 CALL iom_get( numror, 'a_fwb', a_fwb ) 137 ELSE ! as specified in namelist 138 a_fwb = rn_fwb0 139 END IF 140 ! 123 141 IF(lwp)WRITE(numout,*) 124 IF(lwp)WRITE(numout,*)'sbc_fwb : year = ',iyear , ' freshwater budget correction = ', fwfold 125 IF(lwp)WRITE(numout,*)' year = ',iyear-1, ' freshwater budget read = ', a_fwb 126 IF(lwp)WRITE(numout,*)' year = ',iyear-2, ' freshwater budget read = ', a_fwb_b 142 IF(lwp)WRITE(numout,*)'sbc_fwb : initial freshwater-budget adjustment = ', a_fwb, 'kg/m2/s' 143 ! 127 144 ENDIF 128 ! ! Update fwfoldif new year start145 ! ! Update a_fwb if new year start 129 146 ikty = 365 * 86400 / rn_Dt !!bug use of 365 days leap year or 360d year !!!!!!! 130 147 IF( MOD( kt, ikty ) == 0 ) THEN 131 a_fwb_b = a_fwb! mean sea level taking into account the ice+snow148 ! mean sea level taking into account the ice+snow 132 149 ! sum over the global domain 133 150 a_fwb = glob_sum( 'sbcfwb', e1e2t(:,:) * ( ssh(:,:,Kmm) + snwice_mass(:,:) * r1_rho0 ) ) 134 151 a_fwb = a_fwb * 1.e+3 / ( area * rday * 365. ) ! convert in Kg/m3/s = mm/s 135 152 !!gm ! !!bug 365d year 136 fwfold = a_fwb ! current year freshwater budget correction137 ! ! estimate from the previous year budget138 153 ENDIF 139 154 ! 140 155 IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN ! correct the freshwater fluxes 141 zcoef = fwfold* rcp142 emp(:,:) = emp(:,:) + fwfold* tmask(:,:,1)156 zcoef = a_fwb * rcp 157 emp(:,:) = emp(:,:) + a_fwb * tmask(:,:,1) 143 158 qns(:,:) = qns(:,:) - zcoef * sst_m(:,:) * tmask(:,:,1) ! account for change to the heat budget due to fw correction 144 ENDIF 145 ! 146 IF( kt == nitend .AND. lwm ) THEN ! save fwfold value in a file (only one required) 147 CALL ctl_opn( inum, 'EMPave.dat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., narea ) 148 WRITE( inum, "(24X,I8,2ES24.16)" ) nyear, a_fwb_b, a_fwb 149 CLOSE( inum ) 150 ENDIF 159 ! outputs 160 IF( iom_use('hflx_fwb_cea') ) CALL iom_put( 'hflx_fwb_cea', -zcoef * sst_m(:,:) * tmask(:,:,1) ) 161 IF( iom_use('vflx_fwb_cea') ) CALL iom_put( 'vflx_fwb_cea', -a_fwb * tmask(:,:,1) ) 162 ENDIF 163 ! Output restart information 164 IF( lrst_oce ) THEN 165 IF(lwp) WRITE(numout,*) 166 IF(lwp) WRITE(numout,*) 'sbc_fwb : writing FW-budget adjustment to ocean restart file at it = ', kt 167 IF(lwp) WRITE(numout,*) '~~~~' 168 CALL iom_rstput( kt, nitrst, numrow, 'a_fwb', a_fwb ) 169 END IF 170 ! 171 IF( kt == nitend .AND. lwp ) WRITE(numout,*) 'sbc_fwb : final freshwater-budget adjustment = ', a_fwb, 'kg/m2/s' 151 172 ! 152 173 CASE ( 3 ) !== global fwf set to zero and spread out over erp area ==! … … 186 207 qns(:,:) = qns(:,:) - zerp_cor(:,:) * rcp * sst_m(:,:) ! account for change to the heat budget due to fw correction 187 208 erp(:,:) = erp(:,:) + zerp_cor(:,:) 209 ! outputs 210 IF( iom_use('hflx_fwb_cea') ) CALL iom_put( 'hflx_fwb_cea', -zerp_cor(:,:) * rcp * sst_m(:,:) ) 211 IF( iom_use('vflx_fwb_cea') ) CALL iom_put( 'vflx_fwb_cea', -zerp_cor(:,:) ) 188 212 ! 189 213 IF( lwp ) THEN ! control print
Note: See TracChangeset
for help on using the changeset viewer.