Changeset 149 for codes/icosagcm/trunk/src/timeloop_gcm.f90
- Timestamp:
- 04/03/13 12:05:12 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/timeloop_gcm.f90
r148 r149 19 19 USE physics_mod 20 20 USE mpipara 21 USE IOIPSL 22 USE maxicosa 23 USE check_conserve_mod 21 24 USE trace 22 25 USE transfert_mod … … 43 46 REAL(rstd),POINTER :: dtheta_rhodz(:,:),dtheta_rhodzm1(:,:),dtheta_rhodzm2(:,:) 44 47 REAL(rstd),POINTER :: hflux(:,:),wflux(:,:),hfluxt(:,:),wfluxt(:,:) 45 46 48 ! REAL(rstd) :: dt, run_length 47 49 INTEGER :: ind … … 49 51 CHARACTER(len=255) :: scheme_name 50 52 LOGICAL :: fluxt_zero(ndomain) ! set to .TRUE. to start accumulating fluxes in time 53 CHARACTER(len=7) :: first 54 REAL(rstd),SAVE :: jD_cur, jH_cur 55 REAL(rstd),SAVE :: start_time 51 56 LOGICAL, PARAMETER :: check=.FALSE. 52 57 ! INTEGER :: itaumax … … 88 93 CALL allocate_field(f_wfluxt,field_t,type_real,llm+1) 89 94 95 !---------------------------------------------------- 96 IF (TRIM(time_style)=='lmd') Then 97 98 day_step=180 99 CALL getin('day_step',day_step) 100 101 ndays=1 102 CALL getin('ndays',ndays) 103 104 dt = daysec/REAL(day_step) 105 itaumax = ndays*day_step 106 107 calend = 'earth_360d' 108 CALL getin('calend', calend) 109 110 day_ini = 0 111 CALL getin('day_ini',day_ini) 112 113 day_end = 0 114 CALL getin('day_end',day_end) 115 116 annee_ref = 1998 117 CALL getin('annee_ref',annee_ref) 118 119 start_time = 0 120 CALL getin('start_time',start_time) 121 122 write_period=0 123 CALL getin('write_period',write_period) 124 125 write_period=write_period/scale_factor 126 itau_out=FLOOR(write_period/dt) 127 128 PRINT *, 'Output frequency (scaled) set to ',write_period, ' : itau_out = ',itau_out 129 130 mois = 1 ; heure = 0. 131 call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref) 132 jH_ref = jD_ref - int(jD_ref) 133 jD_ref = int(jD_ref) 134 135 CALL ioconf_startdate(INT(jD_ref),jH_ref) 136 write(*,*)'annee_ref, mois, day_ref, heure, jD_ref' 137 write(*,*)annee_ref, mois, day_ref, heure, jD_ref 138 write(*,*)"ndays,day_step,itaumax,dt======>" 139 write(*,*)ndays,day_step,itaumax,dt 140 call ju2ymds(jD_ref+jH_ref,an, mois, jour, heure) 141 write(*,*)'jD_ref+jH_ref,an, mois, jour, heure' 142 write(*,*)jD_ref+jH_ref,an, mois, jour, heure 143 day_end = day_ini + ndays 144 END IF 145 !---------------------------------------------------- 146 90 147 scheme_name='runge_kutta' 91 148 CALL getin('scheme',scheme_name) … … 126 183 ! CALL allocate_field(f_dtheta_rhodzm1,field_t,type_real,llm) 127 184 ! CALL allocate_field(f_dtheta_rhodzm2,field_t,type_real,llm) 128 129 185 ! CALL allocate_field(f_theta,field_t,type_real,llm) 130 186 ! CALL allocate_field(f_dtheta,field_t,type_real,llm) … … 135 191 CALL init_advect_tracer 136 192 CALL init_physics 137 138 139 CALL etat0(f_ps,f_phis,f_theta_rhodz,f_u, 193 !========================================= INITIALIZATION 194 ! CALL dynetat0(f_ps,f_phis,f_theta_rhodz,f_u,f_q) 195 CALL etat0(f_ps,f_phis,f_theta_rhodz,f_u,f_q) 140 196 CALL writefield("phis",f_phis,once=.TRUE.) 141 197 CALL transfert_request(f_q,req_i1) … … 158 214 CALL compute_rhodz(.FALSE., ps, rhodz) 159 215 END DO 160 216 161 217 CALL transfert_request(f_phis,req_i0) 218 CALL transfert_request(f_phis,req_i1) 162 219 CALL transfert_request(f_phis,req_i1) 163 220 … … 170 227 ENDIF 171 228 172 IF (is_mpi_root) PRINT *,"It No :",It," t :",dt*It173 229 IF (mod(it,itau_out)==0 ) THEN 174 CALL writefield("q",f_q) 230 ! IF (is_mpi_root) PRINT *,"It No :",It," t :",dt*It 175 231 CALL update_time_counter(dt*it) 232 CALL compute_conserve(f_ps,f_dps,f_u,f_theta_rhodz,f_phis,it) 176 233 ENDIF 177 178 CALL guided(it*dt,f_ps,f_theta_rhodz,f_u,f_q)234 235 CALL guided(it*dt,f_ps,f_theta_rhodz,f_u,f_q) 179 236 180 237 DO stage=1,nb_stage … … 189 246 CASE (mlf) 190 247 CALL leapfrog_matsuno_scheme(stage) 191 192 248 ! CASE ('leapfrog') 193 ! 249 ! CALL leapfrog_scheme 194 250 ! 195 251 ! CASE ('adam_bashforth') 196 ! 197 ! 252 ! CALL dissip(f_u,f_du,f_ps,f_phis, f_theta_rhodz,f_dtheta_rhodz) 253 ! CALL adam_bashforth_scheme 198 254 CASE DEFAULT 199 255 STOP … … 208 264 IF(MOD(it+1,itau_adv)==0) THEN 209 265 ! CALL transfert_request(f_wfluxt,req_i1) ! FIXME 210 ! 266 ! CALL transfert_request(f_hfluxt,req_e1) ! FIXME 211 267 212 268 CALL advect_tracer(f_hfluxt,f_wfluxt,f_u, f_q,f_rhodz) ! update q and rhodz after RK step … … 227 283 END DO 228 284 ENDIF 229 230 285 END IF 231 286 !---------------------------------------------------- 287 jD_cur = jD_ref + day_ini - day_ref + it/day_step 288 jH_cur = jH_ref + start_time + mod(it,day_step)/float(day_step) 289 jD_cur = jD_cur + int(jH_cur) 290 jH_cur = jH_cur - int(jH_cur) 291 ! print*,"Just b4 phys" 292 CALL physics(it,jD_cur,jH_cur,f_phis, f_ps, f_theta_rhodz, f_u, f_q) 293 !---------------------------------------------------- 232 294 ! CALL physics(it,f_phis, f_ps, f_theta_rhodz, f_u, f_q) 233 295 ENDDO … … 493 555 DO i=ii_begin-dd,ii_end+dd 494 556 ij=(j-1)*iim+i 495 m = ( ap(l) - ap(l+1) + (bp(l)-bp(l+1))*ps(ij) )/g 557 m = ( ap(l) - ap(l+1) + (bp(l)-bp(l+1))*ps(ij) )/g 496 558 IF(comp) THEN 497 559 rhodz(ij,l) = m … … 508 570 STOP 509 571 ELSE 510 !PRINT *, 'No discrepancy between ps and rhodz detected'572 PRINT *, 'No discrepancy between ps and rhodz detected' 511 573 END IF 512 574 END IF
Note: See TracChangeset
for help on using the changeset viewer.