- Timestamp:
- 2012-05-17T18:33:12+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2012/dev_r3385_NOCS04_HAMF/NEMOGCM/NEMO/OPA_SRC/SBC/sbcfwb.F90
r3294 r3396 64 64 INTEGER, INTENT( in ) :: kn_fwb ! ocean time-step index 65 65 ! 66 INTEGER :: inum, ikty, iyear ! local integers 67 REAL(wp) :: z_fwf, z_fwf_nsrf, zsum_fwf, zsum_erp ! local scalars 68 REAL(wp) :: zsurf_neg, zsurf_pos, zsurf_tospread ! - - 69 REAL(wp), POINTER, DIMENSION(:,:) :: ztmsk_neg, ztmsk_pos, ztmsk_tospread, z_wgt, zerp_cor 66 INTEGER :: inum, ikty, iyear ! local integers 67 REAL(wp) :: z_fwf, z_fwf_nsrf, zsum_fwf, zsum_erp ! local scalars 68 REAL(wp) :: zsurf_neg, zsurf_pos, zsurf_tospread, zcoef ! - - 69 REAL(wp), POINTER, DIMENSION(:,:) :: ztmsk_neg, ztmsk_pos, z_wgt ! 2D workspaces 70 REAL(wp), POINTER, DIMENSION(:,:) :: ztmsk_tospread, zerp_cor ! - - 70 71 !!---------------------------------------------------------------------- 71 72 ! … … 96 97 IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN 97 98 z_fwf = glob_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) ) ) / area ! sum over the global domain 98 emp (:,:) = emp (:,:) - z_fwf 99 emps(:,:) = emps(:,:) - z_fwf 99 zcoef = z_fwf * rcp 100 emp(:,:) = emp(:,:) - z_fwf 101 qns(:,:) = qns(:,:) + zcoef * sst_m(:,:) ! ensure fw correction does not change the heat budget 100 102 ENDIF 101 103 ! … … 103 105 ! 104 106 IF( kt == nit000 ) THEN ! initialisation 105 ! 107 ! ! Read the corrective factor on precipitations (fwfold) 106 108 CALL ctl_opn( inum, 'EMPave_old.dat', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 107 109 READ ( inum, "(24X,I8,2ES24.16)" ) iyear, a_fwb_b, a_fwb … … 125 127 ENDIF 126 128 ! 127 IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN ! correct the freshwater fluxes 128 emp (:,:) = emp (:,:) + fwfold 129 emps(:,:) = emps(:,:) + fwfold 130 ENDIF 131 ! 132 IF( kt == nitend .AND. lwp ) THEN ! save fwfold value in a file 129 IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN ! correct the freshwater fluxes 130 zcoef = fwfold * rcp 131 emp(:,:) = emp(:,:) + fwfold 132 qns(:,:) = qns(:,:) - zcoef * sst_m(:,:) ! ensure fw correction does not change the heat budget 133 ENDIF 134 ! 135 IF( kt == nitend .AND. lwp ) THEN ! save fwfold value in a file 133 136 CALL ctl_opn( inum, 'EMPave.dat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., narea ) 134 137 WRITE( inum, "(24X,I8,2ES24.16)" ) nyear, a_fwb_b, a_fwb … … 143 146 ztmsk_neg(:,:) = tmask_i(:,:) - ztmsk_pos(:,:) 144 147 ! 145 zsurf_neg = glob_sum( e1e2t(:,:)*ztmsk_neg(:,:) ) 148 zsurf_neg = glob_sum( e1e2t(:,:)*ztmsk_neg(:,:) ) ! Area filled by <0 and >0 erp 146 149 zsurf_pos = glob_sum( e1e2t(:,:)*ztmsk_pos(:,:) ) 147 150 ! ! fwf global mean 148 z_fwf = glob_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) ) ) / area151 z_fwf = glob_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) ) ) / area 149 152 ! 150 153 IF( z_fwf < 0._wp ) THEN ! spread out over >0 erp area to increase evaporation … … 160 163 z_fwf_nsrf = zsum_fwf / ( zsurf_tospread + rsmall ) 161 164 ! ! weight to respect erp field 2D structure 162 zsum_erp = glob_sum( ztmsk_tospread(:,:) * erp(:,:) * e1e2t(:,:) )165 zsum_erp = glob_sum( ztmsk_tospread(:,:) * erp(:,:) * e1e2t(:,:) ) 163 166 z_wgt(:,:) = ztmsk_tospread(:,:) * erp(:,:) / ( zsum_erp + rsmall ) 164 167 ! ! final correction term to apply … … 168 171 CALL lbc_lnk( zerp_cor, 'T', 1. ) 169 172 ! 170 emp (:,:) = emp(:,:) + zerp_cor(:,:)171 emps(:,:) = emps(:,:) + zerp_cor(:,:)172 erp (:,:) = erp(:,:) + zerp_cor(:,:)173 emp(:,:) = emp(:,:) + zerp_cor(:,:) 174 qns(:,:) = qns(:,:) - zerp_cor(:,:) * rcp * sst_m(:,:) 175 erp(:,:) = erp(:,:) + zerp_cor(:,:) 173 176 ! 174 177 IF( nprint == 1 .AND. lwp ) THEN ! control print
Note: See TracChangeset
for help on using the changeset viewer.