Changeset 377
- Timestamp:
- 04/14/16 23:12:41 (8 years ago)
- Location:
- codes/icosagcm/trunk/src
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/caldyn_hevi.f90
r373 r377 153 153 dtheta_rhodz=f_dtheta_rhodz(ind) 154 154 du=f_du_slow(ind) 155 155 156 IF(hydrostatic) THEN 156 157 CALL compute_caldyn_slow_hydro(u,mass,hflux,du) -
codes/icosagcm/trunk/src/caldyn_kernels_base.f90
r373 r377 302 302 !DIR$ SIMD 303 303 DO ij=ij_begin,ij_end 304 dW(ij,l) = dW(ij,l) + W_etadot(ij,l-1) - W_etadot(ij,l)305 304 dPhi(ij,l) = dPhi(ij,l) - wflux(ij,l) & 306 305 * (geopot(ij,l+1)-geopot(ij,l-1))/(mass(ij,l-1)+mass(ij,l)) 307 306 END DO 308 307 END DO 308 DO l=ll_begin,ll_end 309 !DIR$ SIMD 310 DO ij=ij_begin,ij_end 311 dW(ij,l+1) = dW(ij,l+1) + W_etadot(ij,l) ! update inner+top interfaces 312 dW(ij,l) = dW(ij,l) - W_etadot(ij,l) ! update bottom+inner interfaces 313 END DO 314 END DO 309 315 CALL trace_end("compute_caldyn_vert_nh") 310 316 -
codes/icosagcm/trunk/src/caldyn_kernels_hevi.f90
r375 r377 155 155 156 156 ! Newton-Raphson iteration : Phi_il contains current guess value 157 DO iter=1, 2! 2 iterations should be enough157 DO iter=1,5 ! 2 iterations should be enough 158 158 159 159 ! Compute pressure, A_ik … … 673 673 kup=l 674 674 END IF 675 ! below : "checked" means "formula also valid when kup=kdown (top/bottom)" 675 676 ! compute mil, wil=Wil/mil 676 677 DO ij=ij_begin_ext, ij_end_ext 677 w_il(ij,l) = 2.*W(ij,l)/(rhodz(ij,kdown)+rhodz(ij,kup)) 678 w_il(ij,l) = 2.*W(ij,l)/(rhodz(ij,kdown)+rhodz(ij,kup)) ! checked 678 679 END DO 679 680 ! compute DePhi, v_el, G_el, F_el … … 687 688 W2_el = .5*le_de(ij+u_right) * & 688 689 ( W(ij,l)*w_il(ij,l) + W(ij+t_right,l)*w_il(ij+t_right,l) ) 689 v_el(ij+u_right) = .5*le_de(ij+u_right)*(u(ij+u_right,kup)+u(ij+u_right,kdown)) 690 v_el(ij+u_right) = .5*le_de(ij+u_right)*(u(ij+u_right,kup)+u(ij+u_right,kdown)) ! checked 690 691 G_el(ij+u_right) = v_el(ij+u_right)*W_el - DePhil(ij+u_right,l)*W2_el 691 692 ! Compute on edge 'lup' … … 695 696 W2_el = .5*le_de(ij+u_lup) * & 696 697 ( W(ij,l)*w_il(ij,l) + W(ij+t_lup,l)*w_il(ij+t_lup,l) ) 697 v_el(ij+u_lup) = .5*le_de(ij+u_lup)*( u(ij+u_lup,kup) + u(ij+u_lup,kdown) )698 v_el(ij+u_lup) = .5*le_de(ij+u_lup)*( u(ij+u_lup,kup) + u(ij+u_lup,kdown)) ! checked 698 699 G_el(ij+u_lup) = v_el(ij+u_lup)*W_el - DePhil(ij+u_lup,l)*W2_el 699 700 ! Compute on edge 'ldown' … … 703 704 W2_el = .5*le_de(ij+u_ldown) * & 704 705 ( W(ij,l)*w_il(ij,l) + W(ij+t_ldown,l)*w_il(ij+t_ldown,l) ) 705 v_el(ij+u_ldown) = .5*le_de(ij+u_ldown)*( u(ij+u_ldown,kup) + u(ij+u_ldown,kdown) )706 v_el(ij+u_ldown) = .5*le_de(ij+u_ldown)*( u(ij+u_ldown,kup) + u(ij+u_ldown,kdown)) ! checked 706 707 G_el(ij+u_ldown) = v_el(ij+u_ldown)*W_el - DePhil(ij+u_ldown,l)*W2_el 707 708 END DO … … 715 716 le_de(ij+u_ldown)*DePhil(ij+u_ldown,l)**2 + & 716 717 le_de(ij+u_rdown)*DePhil(ij+u_rdown,l)**2 ) 717 dPhi(ij,l) = gradPhi2(ij,l)*w_il(ij,l)-1/(2*Ai(ij))* & 718 ! gradPhi2(ij,l) = 0. ! FIXME !! 719 720 dPhi(ij,l) = gradPhi2(ij,l)*w_il(ij,l) -1/(2*Ai(ij))* & 718 721 ( DePhil(ij+u_right,l)*v_el(ij+u_right) + & ! -v.gradPhi, 719 722 DePhil(ij+u_rup,l)*v_el(ij+u_rup) + & ! v_el already has le_de … … 722 725 DePhil(ij+u_ldown,l)*v_el(ij+u_ldown) + & 723 726 DePhil(ij+u_rdown,l)*v_el(ij+u_rdown) ) 727 724 728 dW(ij,l) = -1./Ai(ij)*( & ! -div(G_el), 725 729 ne_right*G_el(ij+u_right) + & ! G_el already has le_de … … 731 735 END DO 732 736 END DO 733 737 ! FIXME !! 738 ! F_el(:,:)=0. 739 ! dPhi(:,:)=0. 740 ! dW(:,:)=0. 741 734 742 DO l=ll_begin, ll_end ! compute on k levels (layers) 735 743 ! Compute berni at scalar points … … 765 773 END DO 766 774 END DO 775 ! FIXME !! 776 ! du(:,:)=0. 777 ! hflux(:,:)=0. 767 778 768 779 CALL trace_end("compute_caldyn_slow_NH") -
codes/icosagcm/trunk/src/dcmip_initial_conditions_test_1_2_3_v5.f90
r369 r377 1196 1196 ! Test 3-1 1197 1197 !========== 1198 SUBROUTINE test3_gravity_wave ( lon,lat,p,z,zcoords,u,v,w,t,phis,ps,rho,q)1198 SUBROUTINE test3_gravity_wave (X,lon,lat,p,z,zcoords,u,v,w,t,phis,ps,rho,q) 1199 1199 1200 1200 IMPLICIT NONE … … 1204 1204 1205 1205 real(rstd), intent(in) :: lon, & ! Longitude (radians) 1206 lat ! Latitude (radians) 1206 lat, & ! Latitude (radians) 1207 X ! Reduced Earth reduction factor (DCMIP value = 125) 1207 1208 1208 1209 real(rstd), intent(inout) :: p, & ! Pressure (Pa) … … 1227 1228 ! test case parameters 1228 1229 !----------------------------------------------------------------------- 1229 real(rstd), parameter :: X = 125.d0, & ! Reduced Earth reduction factor1230 real(rstd), parameter :: & 1230 1231 Om = 0.d0, & ! Rotation Rate of Earth 1231 as = a/X, & ! New Radius of small Earth1232 1232 u0 = 20.d0, & ! Reference Velocity 1233 1233 ! u0 = 0.d0, & ! FIXME : no zonal wind for NH tests … … 1243 1243 N2 = N*N, & ! Brunt-Vaisala frequency Squared 1244 1244 bigG = (g*g)/(N2*cp) ! Constant 1245 1245 1246 real(rstd) :: as ! New Radius of small Earth 1247 1246 1248 real(rstd) :: height ! Model level height 1247 1249 real(rstd) :: sin_tmp, cos_tmp ! Calculation of great circle distance … … 1251 1253 real(rstd) :: theta_pert ! Pot-temp perturbation 1252 1254 1255 as = a/X 1256 1253 1257 !----------------------------------------------------------------------- 1254 1258 ! THE VELOCITIES -
codes/icosagcm/trunk/src/disvert_std.f90
r266 r377 1 1 MODULE disvert_std_mod 2 2 USE icosa 3 IMPLICIT NONE 4 PRIVATE 5 3 6 REAL(rstd), SAVE, ALLOCATABLE,TARGET :: ap(:) 4 7 !$OMP THREADPRIVATE(ap) … … 7 10 REAL(rstd), SAVE, ALLOCATABLE,TARGET :: presnivs(:) 8 11 !$OMP THREADPRIVATE(presnivs) 12 13 PUBLIC :: init_disvert, ap, bp, presnivs 9 14 10 15 CONTAINS -
codes/icosagcm/trunk/src/earth_const.f90
r366 r377 17 17 18 18 LOGICAL, SAVE :: boussinesq, hydrostatic 19 !$OMP THREADPRIVATE(boussinesq, hydrostatic) 19 20 20 21 CONTAINS -
codes/icosagcm/trunk/src/etat0.f90
r366 r377 21 21 USE etat0_dcmip4_mod, ONLY : getin_etat0_dcmip4=>getin_etat0 22 22 USE etat0_dcmip5_mod, ONLY : getin_etat0_dcmip5=>getin_etat0 23 USE etat0_bubble_mod, ONLY : getin_etat0_bubble=>getin_etat0 23 24 USE etat0_williamson_mod, ONLY : getin_etat0_williamson=>getin_etat0 24 25 USE etat0_temperature_mod, ONLY: getin_etat0_temperature=>getin_etat0 … … 71 72 CASE ('dcmip5') 72 73 CALL getin_etat0_dcmip5 74 CASE ('bubble') 75 CALL getin_etat0_bubble 73 76 CASE ('williamson91.6') 74 77 autoinit_mass=.FALSE. … … 96 99 ELSE 97 100 PRINT*, 'Bad selector for variable etat0 <',etat0_type, & 98 '> options are <jablonowsky06>, <academic>, <dcmip[1-4]> ' 101 '> options are <isothermal>, <temperature_profile>, <held_suarez>, & 102 &<bubble>, <venus>, <jablonowsky06>, <academic>, <dcmip[1-4]> ' 99 103 STOP 100 104 END IF … … 176 180 USE etat0_dcmip4_mod, ONLY : compute_dcmip4 => compute_etat0 177 181 USE etat0_dcmip5_mod, ONLY : compute_dcmip5 => compute_etat0 182 USE etat0_bubble_mod, ONLY : compute_bubble => compute_etat0 178 183 USE etat0_williamson_mod, ONLY : compute_w91_6 => compute_etat0 179 184 USE etat0_temperature_mod, ONLY: compute_etat0_temperature => compute_etat0 … … 205 210 206 211 ! For NH geopotential and vertical momentum must be initialized. 207 ! Unless autoinit_ massis set to .FALSE. , they will be initialized212 ! Unless autoinit_NH is set to .FALSE. , they will be initialized 208 213 ! to hydrostatic geopotential and zero 209 214 autoinit_mass = .TRUE. … … 239 244 CALL compute_dcmip5(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, q) 240 245 CALL compute_dcmip5(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e, q_e) 246 CASE('bubble') 247 CALL compute_bubble(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, geopot, q) 248 CALL compute_bubble(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e, geopot_e, q_e) 249 ! autoinit_NH = .FALSE. ! compute_bubble initializes geopot 241 250 CASE('williamson91.6') 242 251 CALL compute_w91_6(iim*jjm,lon_i,lat_i, phis, mass(:,1), temp_i(:,1), ulon_i(:,1), ulat_i(:,1)) -
codes/icosagcm/trunk/src/etat0_dcmip3.f90
r367 r377 8 8 9 9 SUBROUTINE compute_etat0(ngrid,lon,lat, phis,ps,temp,ulon,ulat,geopot,q) 10 USE genmod11 10 USE dcmip_initial_conditions_test_1_2_3 12 11 USE disvert_mod … … 27 26 pp=peq 28 27 DO ij=1,ngrid 29 CALL test3_gravity_wave( lon(ij),lat(ij),pp,dummy,0, &28 CALL test3_gravity_wave(scale_factor, lon(ij),lat(ij),pp,dummy,0, & 30 29 dummy,dummy,dummy,dummy,phis(ij),ps(ij),dummy,dummy) 31 30 END DO … … 33 32 DO ij=1,ngrid 34 33 pp = ap(l) + bp(l)*ps(ij) ! half-layer pressure 35 CALL test3_gravity_wave( lon(ij),lat(ij),pp,zz,0, &34 CALL test3_gravity_wave(scale_factor, lon(ij),lat(ij),pp,zz,0, & 36 35 dummy,dummy,dummy,dummy,dummy,dummy,dummy,dummy) 37 36 geopot(ij,l) = g*zz ! initialize geopotential for NH … … 41 40 DO ij=1,ngrid 42 41 pp = .5*(ap(l)+ap(l+1)) + .5*(bp(l)+bp(l+1))*ps(ij) ! full-layer pressure 43 CALL test3_gravity_wave( lon(ij),lat(ij),pp,dummy,0, &42 CALL test3_gravity_wave(scale_factor, lon(ij),lat(ij),pp,dummy,0, & 44 43 ulon(ij,l),ulat(ij,l),dummy,Temp(ij,l),dummy,dummy,dummy,dummy) 45 44 END DO -
codes/icosagcm/trunk/src/etat0_temperature.f90
r328 r377 3 3 USE icosa, ONLY: llm,nqtot 4 4 IMPLICIT NONE 5 PRIVATE 6 5 7 REAL(rstd), SAVE, ALLOCATABLE :: t_profile(:) 6 8 !$OMP THREADPRIVATE(t_profile) 9 10 PUBLIC :: getin_etat0, compute_etat0 11 7 12 CONTAINS 8 13 … … 13 18 USE transfert_omp_mod, ONLY: bcast_omp 14 19 USE free_unit_mod, ONLY : free_unit 15 IMPLICIT NONE16 20 INTEGER :: unit,ok 17 21 INTEGER :: l … … 59 63 SUBROUTINE compute_etat0(ngrid, phis, ps, temp, ulon, ulat, q) 60 64 USE earth_const, ONLY: preff 61 IMPLICIT NONE62 65 INTEGER, INTENT(IN) :: ngrid 63 66 REAL(rstd),INTENT(OUT) :: phis(ngrid) -
codes/icosagcm/trunk/src/observable.f90
r374 r377 169 169 REAL(rstd) :: F_el(3*iim*jjm,llm+1) 170 170 REAL(rstd) :: uu_right, uu_lup, uu_ldown, W_el, DePhil 171 ! NB : u and uh are not in DEC form, they are normal components 172 ! => we must divide by de 171 173 IF(hydrostatic) THEN 172 174 uh(:,:)=u(:,:) … … 178 180 W_el = .5*( W(ij,l)+W(ij+t_right,l) ) 179 181 DePhil = ne_right*(Phi(ij+t_right,l)-Phi(ij,l)) 180 F_el(ij+u_right,l) = DePhil*W_el 182 F_el(ij+u_right,l) = DePhil*W_el/de(ij+u_right) 181 183 ! Compute on edge 'lup' 182 184 W_el = .5*( W(ij,l)+W(ij+t_lup,l) ) 183 185 DePhil = ne_lup*(Phi(ij+t_lup,l)-Phi(ij,l)) 184 F_el(ij+u_lup,l) = DePhil*W_el 186 F_el(ij+u_lup,l) = DePhil*W_el/de(ij+u_lup) 185 187 ! Compute on edge 'ldown' 186 188 W_el = .5*( W(ij,l)+W(ij+t_ldown,l) ) 187 189 DePhil = ne_ldown*(Phi(ij+t_ldown,l)-Phi(ij,l)) 188 F_el(ij+u_ldown,l) = DePhil*W_el 190 F_el(ij+u_ldown,l) = DePhil*W_el/de(ij+u_ldown) 189 191 END DO 190 192 END DO … … 192 194 DO l=ll_begin, ll_end ! compute on k levels (full levels) 193 195 DO ij=ij_begin_ext, ij_end_ext 194 ! w = vertical momentum = g^-2*dPhi/dt = g*uz196 ! w = vertical momentum = g^-2*dPhi/dt = uz/g 195 197 uz(ij,l) = (.5*g)*(W(ij,l)+W(ij,l+1))/rhodz(ij,l) 196 198 ! uh = u-w.grad(Phi) = u - uz.grad(z) -
codes/icosagcm/trunk/src/timeloop_gcm.f90
r376 r377 11 11 12 12 INTEGER, PARAMETER :: itau_sync=10 13 TYPE(t_message),SAVE :: req_ps0, req_mass0, req_theta_rhodz0, req_u0, req_q0 13 TYPE(t_message),SAVE :: req_ps0, req_mass0, req_theta_rhodz0, req_u0, req_q0, req_W0, req_geopot0 14 LOGICAL, SAVE :: positive_theta 14 15 15 16 PUBLIC :: init_timeloop, timeloop … … 33 34 IF (xios_output) itau_out=1 34 35 IF (.NOT. enable_io) itau_out=HUGE(itau_out) 35 36 37 positive_theta=.FALSE. 38 CALL getin('positive_theta',positive_theta) 39 IF(positive_theta .AND. nqtot<1) THEN 40 PRINT *, 'nqtot must be >0 if positive_theta is .TRUE.' 41 STOP 42 END IF 43 36 44 def='ARK2.3' 37 45 CALL getin('time_scheme',def) … … 147 155 CALL init_message(f_u,req_e0_vect,req_u0) 148 156 CALL init_message(f_q,req_i0,req_q0) 157 CALL init_message(f_geopot,req_i0,req_geopot0) 158 CALL init_message(f_W,req_i0,req_W0) 149 159 150 160 END SUBROUTINE init_timeloop … … 198 208 fluxt_zero=.TRUE. 199 209 210 IF(positive_theta) CALL copy_theta_to_q1(f_theta_rhodz,f_rhodz,f_q) 211 200 212 !$OMP MASTER 201 213 CALL SYSTEM_CLOCK(start_clock) … … 226 238 CALL wait_message(req_u0) 227 239 CALL send_message(f_q,req_q0) 228 CALL wait_message(req_q0) 240 CALL wait_message(req_q0) 241 IF(.NOT. hydrostatic) THEN 242 ! CALL send_message(f_geopot,req_geopot0) 243 ! CALL wait_message(req_geopot0) 244 ! CALL send_message(f_W,req_W0) 245 ! CALL wait_message(req_W0) 246 END IF 229 247 ENDIF 230 248 … … 285 303 END DO 286 304 ENDIF 305 IF(positive_theta) CALL copy_q1_to_theta(f_theta_rhodz,f_rhodz,f_q) 287 306 END IF 288 307 … … 341 360 END SUBROUTINE print_iteration 342 361 362 SUBROUTINE copy_theta_to_q1(f_theta_rhodz,f_rhodz,f_q) 363 TYPE(t_field),POINTER :: f_theta_rhodz(:),f_rhodz(:), f_q(:) 364 REAL(rstd), POINTER :: theta_rhodz(:,:), rhodz(:,:), q(:,:,:) 365 INTEGER :: ind 366 DO ind=1, ndomain 367 IF (.NOT. assigned_domain(ind)) CYCLE 368 CALL swap_dimensions(ind) 369 CALL swap_geometry(ind) 370 theta_rhodz=f_theta_rhodz(ind) 371 rhodz=f_rhodz(ind) 372 q=f_q(ind) 373 q(:,:,1) = theta_rhodz(:,:)/rhodz(:,:) 374 END DO 375 END SUBROUTINE copy_theta_to_q1 376 377 SUBROUTINE copy_q1_to_theta(f_theta_rhodz,f_rhodz,f_q) 378 TYPE(t_field),POINTER :: f_theta_rhodz(:),f_rhodz(:), f_q(:) 379 REAL(rstd), POINTER :: theta_rhodz(:,:), rhodz(:,:), q(:,:,:) 380 INTEGER :: ind 381 DO ind=1, ndomain 382 IF (.NOT. assigned_domain(ind)) CYCLE 383 CALL swap_dimensions(ind) 384 CALL swap_geometry(ind) 385 theta_rhodz=f_theta_rhodz(ind) 386 rhodz=f_rhodz(ind) 387 q=f_q(ind) 388 theta_rhodz(:,:) = rhodz(:,:)*q(:,:,1) 389 END DO 390 END SUBROUTINE copy_q1_to_theta 391 343 392 END MODULE timeloop_gcm_mod
Note: See TracChangeset
for help on using the changeset viewer.