- Timestamp:
- 2012-11-21T14:19:18+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2012/dev_NOC_2012_rev3555/NEMOGCM/NEMO/OPA_SRC/SBC/sbcfwb.F90
r3294 r3625 59 59 !! =3 global mean of emp set to zero at each nn_fsbc time step 60 60 !! & spread out over erp area depending its sign 61 !! Note: if sea ice is embedded it is taken into account when computing the budget 61 62 !!---------------------------------------------------------------------- 62 63 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 64 65 INTEGER, INTENT( in ) :: kn_fwb ! ocean time-step index 65 66 ! 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 67 INTEGER :: inum, ikty, iyear ! local integers 68 REAL(wp) :: z_fwf, z_fwf_nsrf, zsum_fwf, zsum_erp ! local scalars 69 REAL(wp) :: zsurf_neg, zsurf_pos, zsurf_tospread, zcoef ! - - 70 REAL(wp), POINTER, DIMENSION(:,:) :: ztmsk_neg, ztmsk_pos, z_wgt ! 2D workspaces 71 REAL(wp), POINTER, DIMENSION(:,:) :: ztmsk_tospread, zerp_cor ! - - 70 72 !!---------------------------------------------------------------------- 71 73 ! … … 87 89 ! 88 90 area = glob_sum( e1e2t(:,:) ) ! interior global domain surface 91 ! 92 #if ! defined key_lim2 && ! defined key_lim3 && ! defined key_cice 93 snwice_mass_b(:,:) = 0.e0 ! no sea-ice model is being used : no snow+ice mass 94 snwice_mass (:,:) = 0.e0 95 #endif 96 ! 89 97 ENDIF 90 98 … … 95 103 ! 96 104 IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN 97 z_fwf = glob_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) ) ) / area ! sum over the global domain 98 emp (:,:) = emp (:,:) - z_fwf 99 emps(:,:) = emps(:,:) - z_fwf 105 z_fwf = glob_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) - snwice_fmass(:,:) ) ) / area ! sum over the global domain 106 zcoef = z_fwf * rcp 107 emp(:,:) = emp(:,:) - z_fwf 108 qns(:,:) = qns(:,:) + zcoef * sst_m(:,:) ! account for change to the heat budget due to fw correction 100 109 ENDIF 101 110 ! 102 111 CASE ( 2 ) !== fwf budget adjusted from the previous year ==! 103 112 ! 104 IF( kt == nit000 ) THEN ! initialisation113 IF( kt == nit000 ) THEN ! initialisation 105 114 ! ! Read the corrective factor on precipitations (fwfold) 106 115 CALL ctl_opn( inum, 'EMPave_old.dat', 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) … … 117 126 ikty = 365 * 86400 / rdttra(1) !!bug use of 365 days leap year or 360d year !!!!!!! 118 127 IF( MOD( kt, ikty ) == 0 ) THEN 119 a_fwb_b = a_fwb 120 a_fwb = glob_sum( e1e2t(:,:) * sshn(:,:) ) ! sum over the global domain 128 a_fwb_b = a_fwb ! mean sea level taking into account the ice+snow 129 ! sum over the global domain 130 a_fwb = glob_sum( e1e2t(:,:) * ( sshn(:,:) + snwice_mass(:,:) * r1_rau0 ) ) 121 131 a_fwb = a_fwb * 1.e+3 / ( area * 86400. * 365. ) ! convert in Kg/m3/s = mm/s 122 132 !!gm ! !!bug 365d year … … 125 135 ENDIF 126 136 ! 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 137 IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN ! correct the freshwater fluxes 138 zcoef = fwfold * rcp 139 emp(:,:) = emp(:,:) + fwfold 140 qns(:,:) = qns(:,:) - zcoef * sst_m(:,:) ! account for change to the heat budget due to fw correction 141 ENDIF 142 ! 143 IF( kt == nitend .AND. lwp ) THEN ! save fwfold value in a file 133 144 CALL ctl_opn( inum, 'EMPave.dat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE., narea ) 134 145 WRITE( inum, "(24X,I8,2ES24.16)" ) nyear, a_fwb_b, a_fwb … … 143 154 ztmsk_neg(:,:) = tmask_i(:,:) - ztmsk_pos(:,:) 144 155 ! 145 zsurf_neg = glob_sum( e1e2t(:,:)*ztmsk_neg(:,:) ) 156 zsurf_neg = glob_sum( e1e2t(:,:)*ztmsk_neg(:,:) ) ! Area filled by <0 and >0 erp 146 157 zsurf_pos = glob_sum( e1e2t(:,:)*ztmsk_pos(:,:) ) 147 ! ! fwf global mean 148 z_fwf = glob_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) ) ) / area158 ! ! fwf global mean (excluding ocean to ice/snow exchanges) 159 z_fwf = glob_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) - snwice_fmass(:,:) ) ) / area 149 160 ! 150 161 IF( z_fwf < 0._wp ) THEN ! spread out over >0 erp area to increase evaporation … … 160 171 z_fwf_nsrf = zsum_fwf / ( zsurf_tospread + rsmall ) 161 172 ! ! weight to respect erp field 2D structure 162 zsum_erp = glob_sum( ztmsk_tospread(:,:) * erp(:,:) * e1e2t(:,:) )173 zsum_erp = glob_sum( ztmsk_tospread(:,:) * erp(:,:) * e1e2t(:,:) ) 163 174 z_wgt(:,:) = ztmsk_tospread(:,:) * erp(:,:) / ( zsum_erp + rsmall ) 164 175 ! ! final correction term to apply … … 168 179 CALL lbc_lnk( zerp_cor, 'T', 1. ) 169 180 ! 170 emp (:,:) = emp(:,:) + zerp_cor(:,:)171 emps(:,:) = emps(:,:) + zerp_cor(:,:)172 erp (:,:) = erp(:,:) + zerp_cor(:,:)181 emp(:,:) = emp(:,:) + zerp_cor(:,:) 182 qns(:,:) = qns(:,:) - zerp_cor(:,:) * rcp * sst_m(:,:) ! account for change to the heat budget due to fw correction 183 erp(:,:) = erp(:,:) + zerp_cor(:,:) 173 184 ! 174 185 IF( nprint == 1 .AND. lwp ) THEN ! control print
Note: See TracChangeset
for help on using the changeset viewer.