Changeset 581
- Timestamp:
- 10/13/17 16:00:58 (7 years ago)
- Location:
- codes/icosagcm/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/diagnostics/observable.f90
r548 r581 5 5 6 6 TYPE(t_field),POINTER, SAVE :: f_buf_i(:), & 7 f_buf_ uh(:), & ! horizontal velocity, different from prognostic velocity if NH7 f_buf_Fel(:), f_buf_uh(:), & ! horizontal velocity, different from prognostic velocity if NH 8 8 f_buf_ulon(:), f_buf_ulat(:), & 9 9 f_buf_u3d(:) ! unused, remove ? … … 28 28 CALL allocate_field(f_buf_ulat,field_t,type_real,llm, name="buf_ulat") 29 29 CALL allocate_field(f_buf_uh, field_u,type_real,llm, name="buf_uh") 30 CALL allocate_field(f_buf_Fel, field_u,type_real,llm+1, name="buf_F_el") 30 31 CALL allocate_field(f_buf_v, field_z,type_real,llm, name="buf_v") 31 32 CALL allocate_field(f_buf_s, field_t,type_real, name="buf_s") … … 60 61 61 62 IF(init) THEN 63 IF(is_master) PRINT *, 'Creating output files ...' 62 64 scalar(1)=dt 63 65 IF (is_omp_master) CALL xios_send_field("timestep", scalar) … … 74 76 75 77 CALL output_field("phis",f_phis) 76 CALL output_field("Ai",geom%Ai) 78 CALL output_field("Ai",geom%Ai) 79 IF(is_master) PRINT *, '... done creating output files. Writing initial condition ...' 77 80 END IF 78 81 … … 120 123 CALL output_field("geopot_init",f_geopot) 121 124 CALL output_field("q_init",f_q) 125 IF(is_master) PRINT *, 'Done writing initial condition ...' 122 126 ELSE 123 127 CALL output_field("uz",f_buf_i) … … 165 169 f_u(:), f_W(:), f_uz(:), & ! IN 166 170 f_uh(:) ! OUT 167 REAL(rstd),POINTER :: geopot(:,:), ps(:), rhodz(:,:), u(:,:), W(:,:), uh(:,:), uz(:,:) 171 REAL(rstd),POINTER :: geopot(:,:), ps(:), rhodz(:,:), u(:,:), W(:,:), uh(:,:), uz(:,:), F_el(:,:) 168 172 INTEGER :: ind 169 173 … … 177 181 W = f_W(ind) 178 182 uh = f_uh(ind) 183 F_el = f_buf_Fel(ind) 179 184 IF(caldyn_eta==eta_mass) THEN 180 185 ps=f_ps(ind) … … 182 187 END IF 183 188 uz = f_uz(ind) 184 CALL compute_prognostic_vel_to_horiz(geopot,rhodz,u,W,uh,uz) 189 !$OMP BARRIER 190 CALL compute_prognostic_vel_to_horiz(geopot,rhodz,u,W, F_el, uh,uz) 191 !$OMP BARRIER 185 192 END DO 186 193 END SUBROUTINE progonostic_vel_to_horiz 187 194 188 SUBROUTINE compute_prognostic_vel_to_horiz(Phi, rhodz, u, W, uh, uz)195 SUBROUTINE compute_prognostic_vel_to_horiz(Phi, rhodz, u, W, F_el, uh, uz) 189 196 USE omp_para 190 197 REAL(rstd), INTENT(IN) :: Phi(iim*jjm,llm+1) … … 220 227 END DO 221 228 229 ! We need a barrier here because we compute F_el above and do a vertical average below 230 !$OMP BARRIER 231 222 232 DO l=ll_begin, ll_end ! compute on k levels (full levels) 223 233 DO ij=ij_begin_ext, ij_end_ext -
codes/icosagcm/trunk/src/initial/etat0.f90
r548 r581 1 1 MODULE etat0_mod 2 2 USE icosa 3 USE omp_para 3 4 IMPLICIT NONE 4 5 PRIVATE … … 10 11 11 12 PUBLIC :: etat0, init_etat0, etat0_type 13 14 ! Important notes for OpenMP 15 ! When etat0 is called, vertical OpenMP parallelism is deactivated. 16 ! Therefore only the omp_level_master thread must work, i.e. : 17 ! !$OMP BARRIER 18 ! DO ind=1,ndomain 19 ! IF (.NOT. assigned_domain(ind) .OR. .NOT. is_omp_level_master) CYCLE 20 ! ... 21 ! END DO 22 ! !$OMP BARRIER 23 ! There MUST be NO OMP BARRIER inside the DO-LOOP or any routine it calls. 12 24 13 25 CONTAINS 14 26 15 27 SUBROUTINE init_etat0 16 USE etat0_database_mod, ONLY: init_etat0_database => init_etat0 17 USE etat0_start_file_mod, ONLY: init_etat0_start_file => init_etat0 18 USE etat0_heldsz_mod, ONLY: init_etat0_held_suarez => init_etat0 19 IMPLICIT NONE 20 28 USE etat0_database_mod, ONLY: init_etat0_database => init_etat0 29 USE etat0_start_file_mod, ONLY: init_etat0_start_file => init_etat0 30 USE etat0_heldsz_mod, ONLY: init_etat0_held_suarez => init_etat0 31 21 32 CALL getin("etat0",etat0_type) 22 33 … … 75 86 USE etat0_start_file_mod, ONLY : etat0_start_file=>etat0 76 87 77 IMPLICIT NONE78 88 TYPE(t_field),POINTER :: f_ps(:) 79 89 TYPE(t_field),POINTER :: f_mass(:) … … 160 170 END SELECT 161 171 162 ! !$OMP BARRIER163 172 IF(autoinit_mass) THEN 164 173 DO ind=1,ndomain 165 IF (.NOT. assigned_domain(ind) ) CYCLE174 IF (.NOT. assigned_domain(ind) .OR. .NOT. is_omp_level_master) CYCLE 166 175 CALL swap_dimensions(ind) 167 176 CALL swap_geometry(ind) … … 175 184 SUBROUTINE etat0_collocated(f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_geopot,f_W, f_q) 176 185 USE theta2theta_rhodz_mod 177 IMPLICIT NONE178 186 TYPE(t_field),POINTER :: f_ps(:) 179 187 TYPE(t_field),POINTER :: f_mass(:) … … 200 208 201 209 DO ind=1,ndomain 202 IF (.NOT. assigned_domain(ind)) CYCLE 210 IF (.NOT. assigned_domain(ind) .OR. .NOT. is_omp_level_master) CYCLE 211 ! IF (.NOT. assigned_domain(ind)) CYCLE 203 212 CALL swap_dimensions(ind) 204 213 CALL swap_geometry(ind) … … 232 241 USE exner_mod 233 242 USE omp_para 234 IMPLICIT NONE235 243 REAL(rstd),INTENT(IN) :: ps(iim*jjm) 236 244 REAL(rstd),INTENT(IN) :: temp(iim*jjm,llm) … … 248 256 CALL compute_pression(ps,p,offset) 249 257 ! flush p 250 !$OMP BARRIER251 258 DO l = ll_begin, ll_end 252 259 DO j=jj_begin-offset,jj_end+offset … … 278 285 ENDDO 279 286 ENDDO 280 !$OMP BARRIER281 287 END SUBROUTINE compute_temperature2entropy 282 288 … … 296 302 USE etat0_dcmip2016_cyclone_mod, ONLY : compute_dcmip2016_cyclone => compute_etat0 297 303 USE etat0_dcmip2016_supercell_mod, ONLY : compute_dcmip2016_supercell => compute_etat0 298 IMPLICIT NONE299 304 REAL(rstd),INTENT(INOUT) :: ps(iim*jjm) 300 305 REAL(rstd),INTENT(INOUT) :: mass(iim*jjm,llm) … … 328 333 autoinit_NH = .NOT. hydrostatic 329 334 w(:,:) = 0 330 331 !$OMP BARRIER332 335 333 336 SELECT CASE (TRIM(etat0_type)) … … 391 394 END IF 392 395 393 !$OMP BARRIER394 395 396 CALL compute_wind_perp_from_lonlat_compound(ulon_e, ulat_e, u) 396 397 … … 405 406 406 407 SUBROUTINE compute_etat0_isothermal(ngrid, phis, ps, temp, ulon, ulat, q) 407 IMPLICIT NONE408 408 INTEGER, INTENT(IN) :: ngrid 409 409 REAL(rstd),INTENT(OUT) :: phis(ngrid) -
codes/icosagcm/trunk/src/output/write_etat0.f90
r548 r581 5 5 CONTAINS 6 6 7 SUBROUTINE write_etat0(it,f_ps,f_phis,f_theta_rhodz,f_u, f_q )7 SUBROUTINE write_etat0(it,f_ps,f_phis,f_theta_rhodz,f_u, f_q, f_geopot, f_W) 8 8 USE icosa 9 9 USE restart_mod … … 20 20 TYPE(t_field),POINTER :: f_u(:) 21 21 TYPE(t_field),POINTER :: f_q(:) 22 TYPE(t_field),POINTER, OPTIONAL :: f_geopot(:) 23 TYPE(t_field),POINTER, OPTIONAL :: f_W(:) 22 24 23 25 TYPE(t_field),POINTER,SAVE :: f_ulon(:) … … 41 43 CALL transfert_request(f_u,req_e1_vect) 42 44 CALL un2ulonlat(f_u, f_ulon, f_ulat) 43 44 CALL write_restart(it,f_ps,f_phis,f_theta_rhodz_1d,f_u, f_ulon, f_ulat, f_q)45 45 46 IF(hydrostatic) THEN 47 CALL write_restart(it,f_ps,f_phis,f_theta_rhodz_1d,f_u, f_ulon, f_ulat, f_q) 48 ELSE 49 CALL write_restart(it,f_ps,f_phis,f_theta_rhodz_1d,f_u, f_ulon, f_ulat, f_q, f_geopot, f_W) 50 END IF 46 51 CALL deallocate_field(f_ulon) 47 52 CALL deallocate_field(f_ulat) -
codes/icosagcm/trunk/src/time/timeloop_gcm.f90
r548 r581 219 219 END IF 220 220 221 IF (write_start) CALL write_etat0(itau0,f_ps, f_phis,f_theta_rhodz,f_u,f_q) ! FIXME : write_start undefined 221 ! IF (write_start) CALL write_etat0(itau0,f_ps, f_phis,f_theta_rhodz,f_u,f_q) 222 IF (write_start) CALL write_etat0(itau0,f_ps, f_phis,f_theta_rhodz,f_u,f_q, f_geopot, f_W) 222 223 223 224 CALL write_output_fields_basic(.TRUE., f_phis, f_ps, f_mass, f_geopot, f_theta_rhodz, f_u, f_W, f_q) … … 337 338 END DO 338 339 339 CALL write_etat0(itau0+itaumax,f_ps, f_phis,f_theta_rhodz,f_u,f_q) 340 ! CALL write_etat0(itau0+itaumax,f_ps, f_phis,f_theta_rhodz,f_u,f_q) 341 CALL write_etat0(itau0+itaumax,f_ps, f_phis,f_theta_rhodz,f_u,f_q, f_geopot, f_W) 340 342 341 343 CALL check_conserve_detailed(it, AAM_dyn, &
Note: See TracChangeset
for help on using the changeset viewer.