- Timestamp:
- 2012-04-18T12:42:56+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2012/dev_r3337_NOCS10_ICB/NEMOGCM/NEMO/OPA_SRC/ICB/icbclv.F90
r3339 r3359 14 14 !! accumulate_calving : 15 15 !! icb_gen : generate test icebergs 16 !! icb_nam : read iceberg namelist17 16 !!---------------------------------------------------------------------- 18 17 USE par_oce ! NEMO parameters … … 29 28 PRIVATE 30 29 31 PUBLIC accumulate_calving ! routine called in xxx.F90 module32 PUBLIC calve_icebergs ! routine called in xxx.F90 module30 PUBLIC accumulate_calving ! routine called in icbrun.F90 module 31 PUBLIC calve_icebergs ! routine called in icbrun.F90 module 33 32 34 33 CONTAINS … … 43 42 !!---------------------------------------------------------------------- 44 43 ! 45 INTEGER :: kt 46 REAL(wp) :: calving_used, rdist, ufact 47 INTEGER :: jn, ji, jj, nmax 48 LOGICAL, SAVE :: first_call = .TRUE. 44 INTEGER, INTENT(in) :: kt 45 ! 46 REAL(wp) :: zcalving_used, zdist, zfact 47 INTEGER :: jn, ji, jj ! loop counters 48 INTEGER :: imx ! temporary integer for max berg class 49 LOGICAL, SAVE :: ll_first_call = .TRUE. 49 50 !!---------------------------------------------------------------------- 50 51 ! … … 52 53 ! Use interior mask: so no bergs in overlap areas and convert from km^3/year to kg/s 53 54 ! this assumes that input is given as equivalent water flux so that pure water density is appropriate 54 ufact = ( (1000._wp)**3 / ( NINT(rday) * nyear_len(1) ) ) * 1000._wp55 berg_grid%calving(:,:) = p_calving(:,:) * tmask_i(:,:) * ufact55 zfact = ( (1000._wp)**3 / ( NINT(rday) * nyear_len(1) ) ) * 1000._wp 56 berg_grid%calving(:,:) = src_calving(:,:) * tmask_i(:,:) * zfact 56 57 57 58 ! Heat in units of W/m2, and mask (just in case) 58 berg_grid%calving_hflx(:,:) = p_calving_hflx(:,:) * tmask_i(:,:)59 berg_grid%calving_hflx(:,:) = src_calving_hflx(:,:) * tmask_i(:,:) 59 60 60 IF( first_call .AND. .NOT.restarted_bergs) THEN ! This is a hack to simplify initialization61 first_call = .FALSE.61 IF( ll_first_call .AND. .NOT. l_restarted_bergs) THEN ! This is a hack to simplify initialization 62 ll_first_call = .FALSE. 62 63 !do jn=1, nclasses 63 64 ! where (berg_grid%calving==0.) berg_grid%stored_ice(:,:,jn)=0. … … 77 78 DO jj = 1,jpj 78 79 DO ji = 1,jpi 79 nmax = berg_grid%maxclass(ji,jj)80 rdist = SUM( rn_distribution(1:nclasses) ) / SUM( rn_distribution(1:nmax) )81 DO jn = 1, nmax80 imx = berg_grid%maxclass(ji,jj) 81 zdist = SUM( rn_distribution(1:nclasses) ) / SUM( rn_distribution(1:imx) ) 82 DO jn = 1, imx 82 83 berg_grid%stored_ice(ji,jj,jn) = berg_grid%stored_ice(ji,jj,jn) + & 83 berg_dt * berg_grid%calving(ji,jj) * rn_distribution(jn) * rdist84 berg_dt * berg_grid%calving(ji,jj) * rn_distribution(jn) * zdist 84 85 END DO 85 86 END DO … … 87 88 88 89 ! before changing the calving, save the amount we're about to use and do budget 89 calving_used = SUM( berg_grid%calving(:,:) )90 zcalving_used = SUM( berg_grid%calving(:,:) ) 90 91 berg_grid%tmp(:,:) = berg_dt * berg_grid%calving_hflx(:,:) * e1e2t(:,:) * tmask_i(:,:) 91 92 berg_grid%stored_heat (:,:) = berg_grid%stored_heat (:,:) + berg_grid%tmp(:,:) 92 CALL incoming_budget( kt, calving_used, berg_grid%tmp )93 CALL incoming_budget( kt, zcalving_used, berg_grid%tmp ) 93 94 ! 94 95 END SUBROUTINE accumulate_calving 95 96 ! ##############################################################################97 96 98 97 SUBROUTINE calve_icebergs() … … 114 113 TYPE(iceberg) :: newberg 115 114 TYPE(point) :: newpt 116 LOGICAL :: lret 117 INTEGER :: ji, jj, jn ! dummy loop indices 118 REAL(wp) :: xi, yj, ddt, calved_to_berg, heat_to_berg 115 INTEGER :: ji, jj, jn ! dummy loop indices 116 REAL(wp) :: zddt, zcalved_to_berg, zheat_to_berg 119 117 !!---------------------------------------------------------------------- 120 118 … … 122 120 123 121 DO jn = 1, nclasses 124 DO jj = icbdj,icbej125 DO ji = icbdi,icbei122 DO jj = nicbdj, nicbej 123 DO ji = nicbdi, nicbei 126 124 ! 127 ddt = 0._wp125 zddt = 0._wp 128 126 icnt = 0 129 127 ! … … 140 138 newpt%mass = rn_initial_mass (jn) 141 139 newpt%thickness = rn_initial_thickness(jn) 142 newpt%width = initial_width (jn)143 newpt%length = initial_length (jn)140 newpt%width = first_width (jn) 141 newpt%length = first_length (jn) 144 142 newberg%mass_scaling = rn_mass_scaling (jn) 145 143 newpt%mass_of_bits = 0._wp ! no bergy 146 144 ! 147 145 newpt%year = current_year 148 newpt%day = current_yearday + ddt / rday146 newpt%day = current_yearday + zddt / rday 149 147 newpt%heat_density = berg_grid%stored_heat(ji,jj) / berg_grid%stored_ice(ji,jj,jn) ! This is in J/kg 150 148 ! 151 149 CALL increment_kounter() 152 newberg%number(:) = kount_bergs(:)150 newberg%number(:) = num_bergs(:) 153 151 ! 154 152 CALL add_new_berg_to_list( newberg, newpt ) 155 153 ! 156 calved_to_berg = rn_initial_mass(jn) * rn_mass_scaling(jn) ! Units of kg154 zcalved_to_berg = rn_initial_mass(jn) * rn_mass_scaling(jn) ! Units of kg 157 155 ! ! Heat content 158 heat_to_berg =calved_to_berg * newpt%heat_density ! Units of J159 berg_grid%stored_heat(ji,jj) = berg_grid%stored_heat(ji,jj) - heat_to_berg156 zheat_to_berg = zcalved_to_berg * newpt%heat_density ! Units of J 157 berg_grid%stored_heat(ji,jj) = berg_grid%stored_heat(ji,jj) - zheat_to_berg 160 158 ! ! Stored mass 161 berg_grid%stored_ice(ji,jj,jn) = berg_grid%stored_ice(ji,jj,jn) - calved_to_berg159 berg_grid%stored_ice(ji,jj,jn) = berg_grid%stored_ice(ji,jj,jn) - zcalved_to_berg 162 160 ! 163 ddt =ddt + berg_dt * 2._wp / 17._wp ! Minor offset to start day !!gm why???161 zddt = zddt + berg_dt * 2._wp / 17._wp ! Minor offset to start day !!gm why??? 164 162 icnt = icnt + 1 165 163 ! 166 CALL calving_budget(ji, jj, jn, calved_to_berg,heat_to_berg )164 CALL calving_budget(ji, jj, jn, zcalved_to_berg, zheat_to_berg ) 167 165 END DO 168 166 icntmax = MAX( icntmax, icnt )
Note: See TracChangeset
for help on using the changeset viewer.