Changeset 186 for codes/icosagcm/trunk/src/timeloop_gcm.f90
- Timestamp:
- 01/09/14 09:56:11 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/timeloop_gcm.f90
r174 r186 7 7 8 8 INTEGER, PARAMETER :: euler=1, rk4=2, mlf=3 9 INTEGER :: itau_sync=10 10 11 TYPE(t_message) :: req_ps0, req_mass0, req_theta_rhodz0, req_u0, req_q0 12 13 TYPE(t_field),POINTER :: f_q(:) 14 TYPE(t_field),POINTER :: f_rhodz(:), f_mass(:), f_massm1(:), f_massm2(:), f_dmass(:) 15 TYPE(t_field),POINTER :: f_phis(:), f_ps(:),f_psm1(:), f_psm2(:), f_dps(:) 16 TYPE(t_field),POINTER :: f_u(:),f_um1(:),f_um2(:), f_du(:) 17 TYPE(t_field),POINTER :: f_theta_rhodz(:),f_theta_rhodzm1(:),f_theta_rhodzm2(:), f_dtheta_rhodz(:) 18 TYPE(t_field),POINTER :: f_hflux(:), f_wflux(:), f_hfluxt(:), f_wfluxt(:) 19 20 INTEGER :: nb_stage, matsuno_period, scheme 9 INTEGER, PARAMETER :: itau_sync=10 10 11 TYPE(t_message),SAVE :: req_ps0, req_mass0, req_theta_rhodz0, req_u0, req_q0 12 13 TYPE(t_field),POINTER,SAVE :: f_q(:) 14 TYPE(t_field),POINTER,SAVE :: f_rhodz(:), f_mass(:), f_massm1(:), f_massm2(:), f_dmass(:) 15 TYPE(t_field),POINTER,SAVE :: f_phis(:), f_ps(:),f_psm1(:), f_psm2(:), f_dps(:) 16 TYPE(t_field),POINTER,SAVE :: f_u(:),f_um1(:),f_um2(:), f_du(:) 17 TYPE(t_field),POINTER,SAVE :: f_theta_rhodz(:),f_theta_rhodzm1(:),f_theta_rhodzm2(:), f_dtheta_rhodz(:) 18 TYPE(t_field),POINTER,SAVE :: f_hflux(:), f_wflux(:), f_hfluxt(:), f_wfluxt(:) 19 20 INTEGER,SAVE :: nb_stage, matsuno_period, scheme 21 !$OMP THREADPRIVATE(nb_stage, matsuno_period, scheme) 21 22 22 23 REAL(rstd),SAVE :: jD_cur, jH_cur 24 !$OMP THREADPRIVATE(jD_cur, jH_cur) 23 25 REAL(rstd),SAVE :: start_time 24 26 !$OMP THREADPRIVATE(start_time) 25 27 CONTAINS 26 28 … … 39 41 USE transfert_mod 40 42 USE check_conserve_mod 41 USE ioipsl42 43 USE output_field_mod 43 44 USE write_field … … 47 48 48 49 !---------------------------------------------------- 49 IF (TRIM(time_style)=='lmd') Then50 51 day_step=18052 CALL getin('day_step',day_step)53 54 ndays=155 CALL getin('ndays',ndays)56 57 dt = daysec/REAL(day_step)58 itaumax = ndays*day_step59 60 calend = 'earth_360d'61 CALL getin('calend', calend)62 63 day_ini = 064 CALL getin('day_ini',day_ini)65 66 day_end = 067 CALL getin('day_end',day_end)68 69 annee_ref = 199870 CALL getin('annee_ref',annee_ref)71 72 start_time = 073 CALL getin('start_time',start_time)74 75 76 write_period=077 CALL getin('write_period',write_period)78 79 write_period=write_period/scale_factor80 itau_out=FLOOR(write_period/dt)81 82 PRINT *, 'Output frequency (scaled) set to ',write_period, ' : itau_out = ',itau_out83 84 mois = 1 ; heure = 0.85 call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref)86 jH_ref = jD_ref - int(jD_ref)87 jD_ref = int(jD_ref)88 89 CALL ioconf_startdate(INT(jD_ref),jH_ref)90 write(*,*)'annee_ref, mois, day_ref, heure, jD_ref'91 write(*,*)annee_ref, mois, day_ref, heure, jD_ref92 write(*,*)"ndays,day_step,itaumax,dt======>"93 write(*,*)ndays,day_step,itaumax,dt94 call ju2ymds(jD_ref+jH_ref,an, mois, jour, heure)95 write(*,*)'jD_ref+jH_ref,an, mois, jour, heure'96 write(*,*)jD_ref+jH_ref,an, mois, jour, heure97 day_end = day_ini + ndays98 END IF50 ! IF (TRIM(time_style)=='lmd') Then 51 52 ! day_step=180 53 ! CALL getin('day_step',day_step) 54 55 ! ndays=1 56 ! CALL getin('ndays',ndays) 57 58 ! dt = daysec/REAL(day_step) 59 ! itaumax = ndays*day_step 60 61 ! calend = 'earth_360d' 62 ! CALL getin('calend', calend) 63 64 ! day_ini = 0 65 ! CALL getin('day_ini',day_ini) 66 67 ! day_end = 0 68 ! CALL getin('day_end',day_end) 69 70 ! annee_ref = 1998 71 ! CALL getin('annee_ref',annee_ref) 72 73 ! start_time = 0 74 ! CALL getin('start_time',start_time) 75 76 ! 77 ! write_period=0 78 ! CALL getin('write_period',write_period) 79 ! 80 ! write_period=write_period/scale_factor 81 ! itau_out=FLOOR(write_period/dt) 82 ! 83 ! PRINT *, 'Output frequency (scaled) set to ',write_period, ' : itau_out = ',itau_out 84 85 ! mois = 1 ; heure = 0. 86 ! call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref) 87 ! jH_ref = jD_ref - int(jD_ref) 88 ! jD_ref = int(jD_ref) 89 ! 90 ! CALL ioconf_startdate(INT(jD_ref),jH_ref) 91 ! write(*,*)'annee_ref, mois, day_ref, heure, jD_ref' 92 ! write(*,*)annee_ref, mois, day_ref, heure, jD_ref 93 ! write(*,*)"ndays,day_step,itaumax,dt======>" 94 ! write(*,*)ndays,day_step,itaumax,dt 95 ! call ju2ymds(jD_ref+jH_ref,an, mois, jour, heure) 96 ! write(*,*)'jD_ref+jH_ref,an, mois, jour, heure' 97 ! write(*,*)jD_ref+jH_ref,an, mois, jour, heure 98 ! day_end = day_ini + ndays 99 ! END IF 99 100 !---------------------------------------------------- 100 101 101 102 IF (xios_output) itau_out=1 103 IF (.NOT. enable_io) itau_out=HUGE(itau_out) 102 104 103 105 ! Time-independant orography … … 178 180 CALL init_check_conserve 179 181 CALL init_physics 182 180 183 CALL etat0(f_ps,f_mass,f_phis,f_theta_rhodz,f_u, f_q) 181 184 … … 221 224 LOGICAL :: fluxt_zero(ndomain) ! set to .TRUE. to start accumulating fluxes in time 222 225 LOGICAL, PARAMETER :: check=.FALSE. 223 226 INTEGER :: start_clock 227 INTEGER :: stop_clock 228 INTEGER :: rate_clock 229 224 230 CALL caldyn_BC(f_phis, f_wflux) ! set constant values in first/last interfaces 225 231 226 ! $OMP BARRIER232 !!$OMP BARRIER 227 233 DO ind=1,ndomain 228 234 CALL swap_dimensions(ind) … … 237 243 fluxt_zero=.TRUE. 238 244 245 !$OMP MASTER 246 CALL SYSTEM_CLOCK(start_clock) 247 !$OMP END MASTER 248 249 CALL trace_on 250 239 251 DO it=0,itaumax 240 252 … … 242 254 IF (MOD(it,itau_sync)==0) THEN 243 255 CALL send_message(f_ps,req_ps0) 256 CALL wait_message(req_ps0) 244 257 CALL send_message(f_mass,req_mass0) 258 CALL wait_message(req_mass0) 245 259 CALL send_message(f_theta_rhodz,req_theta_rhodz0) 260 CALL wait_message(req_theta_rhodz0) 246 261 CALL send_message(f_u,req_u0) 262 CALL wait_message(req_u0) 247 263 CALL send_message(f_q,req_q0) 248 CALL wait_message(req_ps0)249 CALL wait_message(req_mass0)250 CALL wait_message(req_theta_rhodz0)251 CALL wait_message(req_u0)252 264 CALL wait_message(req_q0) 265 266 ! CALL wait_message(req_ps0) 267 ! CALL wait_message(req_mass0) 268 ! CALL wait_message(req_theta_rhodz0) 269 ! CALL wait_message(req_u0) 270 ! CALL wait_message(req_q0) 253 271 ENDIF 254 255 ! IF (is_mpi_root) PRINT *,"It No :",It," t :",dt*It 272 273 !$OMP MASTER 274 IF (is_mpi_root) PRINT *,"It No :",It," t :",dt*It 275 !$OMP END MASTER 256 276 IF (mod(it,itau_out)==0 ) THEN 257 277 CALL update_time_counter(dt*it) … … 279 299 280 300 IF (MOD(it+1,itau_dissip)==0) THEN 301 ! CALL send_message(f_ps,req_ps) 302 ! CALL wait_message(req_ps) 303 281 304 IF(caldyn_eta==eta_mass) THEN 282 305 DO ind=1,ndomain 306 IF (.NOT. assigned_domain(ind)) CYCLE 283 307 CALL swap_dimensions(ind) 284 308 CALL swap_geometry(ind) … … 287 311 END DO 288 312 ENDIF 313 ! CALL send_message(f_mass,req_mass) 314 ! CALL wait_message(req_mass) 289 315 CALL dissip(f_u,f_du,f_mass,f_phis, f_theta_rhodz,f_dtheta_rhodz) 316 ! CALL send_message(f_mass,req_mass) 317 ! CALL wait_message(req_mass) 290 318 CALL euler_scheme(.FALSE.) ! update only u, theta 291 319 END IF … … 299 327 IF (check) THEN 300 328 DO ind=1,ndomain 329 IF (.NOT. assigned_domain(ind)) CYCLE 301 330 CALL swap_dimensions(ind) 302 331 CALL swap_geometry(ind) … … 316 345 ! jH_cur = jH_cur - int(jH_cur) 317 346 CALL physics(it,jD_cur,jH_cur,f_phis, f_ps, f_theta_rhodz, f_u, f_q) 347 318 348 ENDDO 319 349 350 CALL check_conserve(f_ps,f_dps,f_u,f_theta_rhodz,f_phis,it) 351 352 !$OMP MASTER 353 CALL SYSTEM_CLOCK(stop_clock) 354 CALL SYSTEM_CLOCK(count_rate=rate_clock) 355 356 IF (mpi_rank==0) THEN 357 PRINT *,"Time elapsed : ",(stop_clock-start_clock)*1./rate_clock 358 ENDIF 359 !$OMP END MASTER 320 360 321 361 CONTAINS … … 329 369 330 370 DO ind=1,ndomain 371 IF (.NOT. assigned_domain(ind)) CYCLE 331 372 CALL swap_dimensions(ind) 332 373 CALL swap_geometry(ind) … … 390 431 391 432 DO ind=1,ndomain 433 IF (.NOT. assigned_domain(ind)) CYCLE 392 434 CALL swap_dimensions(ind) 393 435 CALL swap_geometry(ind) … … 408 450 ENDDO 409 451 ENDIF 410 CALL send_message(f_ps,req_ps) 452 ! CALL send_message(f_ps,req_ps) 453 !ym no overlap for now 454 ! CALL wait_message(req_ps) 411 455 412 456 ELSE ! Lagrangian coordinate, deal with mass 413 457 DO ind=1,ndomain 458 IF (.NOT. assigned_domain(ind)) CYCLE 414 459 CALL swap_dimensions(ind) 415 460 CALL swap_geometry(ind) … … 433 478 ENDDO 434 479 END DO 435 CALL send_message(f_mass,req_mass) 480 ! CALL send_message(f_mass,req_mass) 481 !ym no overlap for now 482 ! CALL wait_message(req_mass) 436 483 437 484 END IF … … 439 486 ! now deal with other prognostic variables 440 487 DO ind=1,ndomain 488 IF (.NOT. assigned_domain(ind)) CYCLE 441 489 CALL swap_dimensions(ind) 442 490 CALL swap_geometry(ind) … … 488 536 tau = dt/nb_stage 489 537 DO ind=1,ndomain 538 IF (.NOT. assigned_domain(ind)) CYCLE 490 539 CALL swap_dimensions(ind) 491 540 CALL swap_geometry(ind)
Note: See TracChangeset
for help on using the changeset viewer.