Changeset 220
- Timestamp:
- 12/05/18 14:32:29 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SOURCES/climat_forcage_mod.f90
r219 r220 38 38 real,dimension(nx,ny) :: Zs !< surface topography above sea level 39 39 40 integer :: typerun ! 1 for steady state using snap 1, 41 ! 2 for steady state using snap 2 ... 42 ! 0 for transient 40 43 41 44 ! S0 topo de ref correspondant a la climato est lu dans lect_topo … … 188 191 189 192 190 namelist/clim_forcage/clim_ref_file,ttr,forcage_file1,forcage_file2, rappact,mincoefbmelt,maxcoefbmelt,filforc,lapserate193 namelist/clim_forcage/clim_ref_file,ttr,forcage_file1,forcage_file2,typerun,rappact,mincoefbmelt,maxcoefbmelt,filforc,lapserate 191 194 192 195 rewind(num_param) ! pour revenir au debut du fichier param_list.dat … … 204 207 write(num_rep_42,'(A,A)') 'forcage_file1 = ', forcage_file1 205 208 write(num_rep_42,'(A,A)') 'forcage_file2 = ', forcage_file2 209 write(num_rep_42,'(A,A)') 'typerun = ', typerun 206 210 write(num_rep_42,'(A,A)') 'rappact = ', rappact 207 211 write(num_rep_42,*) 'mincoefbmelt = ', mincoefbmelt … … 234 238 real,dimension(nx,ny,12) :: prmois ! precip sur topo Zs 235 239 236 237 238 if(time.le.tdate(1)) then ! time avant le debut du fichier forcage 240 real (kind=kind(0.d0)) :: timeloc 241 242 if (typerun.eq.0) then 243 timeloc = time 244 else if ( (typerun .gt. 0) .and. (typerun .le. ubound(ttr,dim=1)) ) then 245 timeloc = ttr(typerun) 246 else 247 write(*,*) "Unknown type of simulation for climat_forcage, abort" 248 STOP 249 end if 250 251 if(timeloc.le.tdate(1)) then ! time avant le debut du fichier forcage 239 252 sealevel=spert(1) 240 253 coeft=alphat(1) … … 242 255 ift=1 243 256 244 else if (time .ge.tdate(nft)) then ! time apres la fin du fichier forcage257 else if (timeloc.ge.tdate(nft)) then ! time apres la fin du fichier forcage 245 258 sealevel=spert(nft) 246 259 coeft=alphat(nft) … … 253 266 do i=ift,nft-1 ! interpolation entre i et i+1 254 267 255 if((time .ge.tdate(i)).and.(time.lt.tdate(i+1))) then ! cas general268 if((timeloc.ge.tdate(i)).and.(timeloc.lt.tdate(i+1))) then ! cas general 256 269 sealevel=spert(i)+(spert(i+1)-spert(i))* & 257 (time -tdate(i))/(tdate(i+1)-tdate(i))270 (timeloc-tdate(i))/(tdate(i+1)-tdate(i)) 258 271 259 272 coeft=alphat(i)+(alphat(i+1)-alphat(i))* & 260 (time -tdate(i))/(tdate(i+1)-tdate(i))273 (timeloc-tdate(i))/(tdate(i+1)-tdate(i)) 261 274 262 275 coefp=alphap(i)+(alphap(i+1)-alphap(i))* & 263 (time -tdate(i))/(tdate(i+1)-tdate(i))276 (timeloc-tdate(i))/(tdate(i+1)-tdate(i)) 264 277 265 278 ift=i … … 272 285 slv(:,:)=sealevel 273 286 274 if(time .le.ttr(1)) then ! time en dehors des limites du fichier forcage287 if(timeloc.le.ttr(1)) then ! time en dehors des limites du fichier forcage 275 288 coeftime=0. 276 289 !~ do j=1,ny … … 282 295 !~ end do 283 296 itr=1 284 else if (time .ge.ttr(ntr)) then ! mis a 0297 else if (timeloc.ge.ttr(ntr)) then ! mis a 0 285 298 coeftime=1. 286 299 itr=ntr … … 295 308 itr=1 296 309 do l=itr,ntr-1 ! interpolation entre i et i+1 297 if((time .ge.ttr(l)).and.(time.lt.ttr(l+1))) then ! test tranche298 coeftime= (time -ttr(l))/(ttr(l+1)-ttr(l))310 if((timeloc.ge.ttr(l)).and.(timeloc.lt.ttr(l+1))) then ! test tranche 311 coeftime= (timeloc-ttr(l))/(ttr(l+1)-ttr(l)) 299 312 ! do j=1,ny 300 313 ! do i=1,nx … … 345 358 346 359 347 print*,'Tmois',Tmois(142,14,1)348 print*,'prmois',prmois(142,14,1)349 360 !$OMP WORKSHARE 350 361 Tann=sum(Tmois,dim=3)/12.
Note: See TracChangeset
for help on using the changeset viewer.