Changeset 289
- Timestamp:
- 11/15/19 17:38:11 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SOURCES/bmelt-ismip6-param_mod.f90
r276 r289 43 43 integer :: bmelt_time !< pour selectionner le type de calcul de bmelt 44 44 double precision,dimension(nx,ny) :: bmelt_anom !< anomalie de bmelt pour exp initMIP abmb 45 double precision,dimension(nx,ny,nzoc) :: TF_0 !> thermal_forcing initial46 double precision,dimension(:,:,:,:),allocatable :: TF_ anom !< anomalie dethermal_forcing pour exp ISMIP45 ! double precision,dimension(nx,ny,nzoc) :: TF_0 !> thermal_forcing initial 46 double precision,dimension(:,:,:,:),allocatable :: TF_time !< snapshots thermal_forcing pour exp ISMIP 47 47 real,dimension(:),allocatable :: time_snap !> date des snapshots indice : nb de nb_snap 48 48 real :: time_depart_snaps !> temps du debut premier snapshot … … 112 112 thermal_forcing(:,:,:) = 3.5 113 113 endwhere 114 TF_0(:,:,:) = thermal_forcing(:,:,:)114 ! TF_0(:,:,:) = thermal_forcing(:,:,:) 115 115 116 116 ! ______ Anomalies... … … 132 132 call Read_Ncdf_var('abmb',file_bmelt_anom,tab2d) 133 133 bmelt_anom (:,:) = tab2d(:,:) 134 elseif (bmelt_time == 2) then ! fichier 3D de TF_ anom: lecture des snapshots134 elseif (bmelt_time == 2) then ! fichier 3D de TF_time : lecture des snapshots 135 135 ! allocation dynamique de time_snap 136 136 if (allocated(time_snap)) then … … 148 148 stop 149 149 end if 150 ! allocation dynamique de TF_ anom151 if (allocated(TF_ anom)) then152 deallocate(TF_ anom,stat=err)150 ! allocation dynamique de TF_time 151 if (allocated(TF_time)) then 152 deallocate(TF_time,stat=err) 153 153 if (err/=0) then 154 print *,"Erreur à la desallocation de TF_ anom",err154 print *,"Erreur à la desallocation de TF_time",err 155 155 stop 156 156 end if 157 157 end if 158 158 159 allocate(TF_ anom(nx,ny,nzoc,nb_snap),stat=err)159 allocate(TF_time(nx,ny,nzoc,nb_snap),stat=err) 160 160 if (err/=0) then 161 print *,"erreur a l'allocation du tableau TF_ anom",err161 print *,"erreur a l'allocation du tableau TF_time ",err 162 162 print *,"nx,ny,nb_snap = ",nx,',',ny,',',nb_snap 163 163 stop … … 165 165 ! lecture de tann_snap 166 166 call Read_Ncdf_var('thermal_forcing',file_bmelt_anom,tab4D) 167 TF_ anom(:,:,:,:) = tab4D(:,:,:,:)167 TF_time(:,:,:,:) = tab4D(:,:,:,:) 168 168 169 169 ! lecture de time_snap … … 299 299 end subroutine bmeltshelf 300 300 301 subroutine TF_ISMIP_RCM ! calcule le thermal forcing a partir des snapshots d'anomalies301 subroutine TF_ISMIP_RCM ! calcule le thermal forcing a partir des snapshots 302 302 303 303 implicit none 304 integer :: k, k_snap ! pour calculer les indices de temps 305 real :: time_prec 304 integer :: k ! pour calculer les indices de temps 306 305 real,dimension(nx,ny,nzoc) :: thermal_forcing_time ! pour calcul Thermal forcing 307 306 … … 314 313 ! en general les snapshots vont de 1995 a 2100 (time_snap de 0 à 105) 315 314 if(time.lt.time_snap(1)) then ! time avant le forcage 316 thermal_forcing_time(:,:,:) = TF_0(:,:,:) 317 k_snap = 1 318 ! S_ref(:,:) = S(:,:) ! du coup sera la surface de reference avant le forcage 319 time_prec = time 315 thermal_forcing_time(:,:,:) = TF_time(:,:,:,1) 320 316 else if (time.ge.time_snap(nb_snap)) then ! time apres le forcage 321 thermal_forcing_time(:,:,:) = TF_0(:,:,:) + TF_anom(:,:,:,nb_snap) 322 if (abs(time-time_prec-1.).lt.dt) then ! 323 time_prec = time_prec + 1 324 endif 317 thermal_forcing_time(:,:,:) = TF_time(:,:,:,nb_snap) 325 318 else ! cas general 326 319 do k = 1 , nb_snap-1 327 320 if((time.ge.time_snap(k)).and.(time.lt.time_snap(k+1))) then ! entre k et k+1 328 thermal_forcing_time(:,:,:) = TF_0(:,:,:) + TF_anom(:,:,:,k) + (TF_anom(:,:,:,k+1)-TF_anom(:,:,:,k)) * & 329 (time-time_snap(k))/(time_snap(k+1)-time_snap(k)) 330 ! exactement sur le snapshot et avec un ecart 1 an par rapport au precedent stockage 331 ! write(6,*) 'time,tests',k,time,time-time_snap(k),time-time_prec-1. 332 if ((abs(time-time_snap(k)).le.dt).and.(abs(time-time_prec-1.).lt.dt)) then 333 k_snap = k 334 time_prec = time_snap(k) ! time_prec est le temps du precedent 335 endif 336 exit 321 !cdc version avec interpolation lineaire entre 2 annees 322 !~ thermal_forcing_time(:,:,:) = TF_time(:,:,:,k) + (TF_time(:,:,:,k+1)-TF_time(:,:,:,k)) * & 323 !~ (time-time_snap(k))/(time_snap(k+1)-time_snap(k)) 324 !cdc version IMSIP avec annee n => TF(n) pendant un an 325 thermal_forcing_time(:,:,:) = TF_time(:,:,:,k) 337 326 endif 338 327 end do … … 340 329 341 330 thermal_forcing(:,:,:) = thermal_forcing_time(:,:,:) 342 ! print*,'TF_ISMIP_RCM time_snap TF', k, time_snap(k), time_snap(k+1), thermal_forcing_time(163,89,1), thermal_forcing_time(194,131,1),TF_0(163,89,1),TF_0(194,131,1)331 !~ print*,'TF_ISMIP_RCM time_snap TF', k, time_snap(k), time_snap(k+1), thermal_forcing_time(190,220,1), thermal_forcing_time(190,220,30),TF_time(190,220,1,1),TF_time(190,220,30,1) 343 332 344 333 end subroutine TF_ISMIP_RCM
Note: See TracChangeset
for help on using the changeset viewer.