Changeset 295 for codes/icosagcm/trunk/src/caldyn_gcm.f90
- Timestamp:
- 10/31/14 14:52:01 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/caldyn_gcm.f90
r286 r295 33 33 USE exner_mod 34 34 USE mpipara 35 USE omp_para 35 36 IMPLICIT NONE 36 37 CHARACTER(len=255) :: def … … 50 51 STOP 51 52 END SELECT 52 IF (is_m pi_root) PRINT *, 'caldyn_conserv=',def53 IF (is_master) PRINT *, 'caldyn_conserv=',def 53 54 54 55 CALL allocate_caldyn … … 72 73 CALL allocate_field(f_qv,field_z,type_real,llm) 73 74 74 CALL allocate_field(f_buf_i, field_t,type_real,llm )75 CALL allocate_field(f_buf_i, field_t,type_real,llm,name="buffer_i") 75 76 CALL allocate_field(f_buf_p, field_t,type_real,llm+1) 76 77 CALL allocate_field(f_buf_u3d, field_t,type_real,3,llm) ! 3D vel at cell centers … … 102 103 INTEGER :: ind,i,j,ij,l 103 104 104 IF ( omp_first) THEN105 IF (is_omp_first_level) THEN 105 106 DO ind=1,ndomain 106 107 IF (.NOT. assigned_domain(ind)) CYCLE … … 128 129 ENDIF 129 130 130 !!$OMP BARRIER131 !$OMP BARRIER 131 132 END SUBROUTINE caldyn_BC 132 133 … … 143 144 USE omp_para 144 145 USE output_field_mod 146 USE checksum_mod 145 147 IMPLICIT NONE 146 148 LOGICAL,INTENT(IN) :: write_out … … 291 293 END SELECT 292 294 293 ! !$OMP BARRIER295 !$OMP BARRIER 294 296 IF (write_out) THEN 295 297 296 IF (is_m pi_root) PRINT *,'CALL write_output_fields'298 IF (is_master) PRINT *,'CALL write_output_fields' 297 299 298 300 ! ---> for openMP test to fix later … … 450 452 451 453 !!! Compute exner function and geopotential 452 DO l = 1,llm 454 IF (is_omp_level_master) THEN ! no openMP on vertical due to dependency 455 DO l = 1,llm 453 456 ! !$OMP DO SCHEDULE(STATIC) 454 457 !DIR$ SIMD 455 DO ij=ij_begin_ext,ij_end_ext456 p_ik = ptop + mass_ak(l) + mass_bk(l)*ps(ij) ! FIXME : leave ps for the moment ; change ps to Ms later457 ! p_ik = ptop + g*(mass_ak(l)+ mass_bk(l)*ps(i,j))458 exner_ik = cpp * (p_ik/preff) ** kappa459 pk(ij,l) = exner_ik458 DO ij=ij_begin_ext,ij_end_ext 459 p_ik = ptop + mass_ak(l) + mass_bk(l)*ps(ij) ! FIXME : leave ps for the moment ; change ps to Ms later 460 ! p_ik = ptop + g*(mass_ak(l)+ mass_bk(l)*ps(i,j)) 461 exner_ik = cpp * (p_ik/preff) ** kappa 462 pk(ij,l) = exner_ik 460 463 ! specific volume v = kappa*theta*pi/p = dphi/g/rhodz 461 geopot(ij,l+1) = geopot(ij,l) + (g*kappa)*rhodz(ij,l)*theta(ij,l)*exner_ik/p_ik464 geopot(ij,l+1) = geopot(ij,l) + (g*kappa)*rhodz(ij,l)*theta(ij,l)*exner_ik/p_ik 462 465 ENDDO 463 ENDDO464 466 ENDDO 467 ENDIF 465 468 ELSE 466 469 ! We are using a Lagrangian vertical coordinate … … 471 474 IF(boussinesq) THEN ! compute only geopotential : pressure pk will be computed in compute_caldyn_horiz 472 475 ! specific volume 1 = dphi/g/rhodz 473 DO l = 1,llm 476 IF (is_omp_level_master) THEN ! no openMP on vertical due to dependency 477 DO l = 1,llm 474 478 ! !$OMP DO SCHEDULE(STATIC) 475 479 !DIR$ SIMD … … 477 481 geopot(ij,l+1) = geopot(ij,l) + g*rhodz(ij,l) 478 482 ENDDO 479 ENDDO 483 ENDDO 484 ENDIF 480 485 ELSE ! non-Boussinesq, compute geopotential and Exner pressure 481 486 ! uppermost layer 482 !DIR$ SIMD 483 DO ij=ij_begin_ext,ij_end_ext 484 pk(ij,llm) = ptop + (.5*g)*rhodz(ij,llm) 485 END DO 486 ! other layers 487 DO l = llm-1, 1, -1 488 489 ! !$OMP DO SCHEDULE(STATIC) 490 !DIR$ SIMD 491 DO ij=ij_begin_ext,ij_end_ext 492 pk(ij,l) = pk(ij,l+1) + (.5*g)*(rhodz(ij,l)+rhodz(ij,l+1)) 493 END DO 494 END DO 487 IF (is_omp_level_master) THEN ! no openMP on vertical due to dependency 488 489 !DIR$ SIMD 490 DO ij=ij_begin_ext,ij_end_ext 491 pk(ij,llm) = ptop + (.5*g)*rhodz(ij,llm) 492 END DO 493 ! other layers 494 DO l = llm-1, 1, -1 495 496 ! !$OMP DO SCHEDULE(STATIC) 497 !DIR$ SIMD 498 DO ij=ij_begin_ext,ij_end_ext 499 pk(ij,l) = pk(ij,l+1) + (.5*g)*(rhodz(ij,l)+rhodz(ij,l+1)) 500 END DO 501 END DO 495 502 ! surface pressure (for diagnostics) 496 DO ij=ij_begin_ext,ij_end_ext497 ps(ij) = pk(ij,1) + (.5*g)*rhodz(ij,1)498 END DO503 DO ij=ij_begin_ext,ij_end_ext 504 ps(ij) = pk(ij,1) + (.5*g)*rhodz(ij,1) 505 END DO 499 506 500 507 ! specific volume v = kappa*theta*pi/p = dphi/g/rhodz 501 DO l = 1,llm508 DO l = 1,llm 502 509 503 510 ! !$OMP DO SCHEDULE(STATIC) 504 511 !DIR$ SIMD 505 DO ij=ij_begin_ext,ij_end_ext 506 p_ik = pk(ij,l) 507 exner_ik = cpp * (p_ik/preff) ** kappa 508 geopot(ij,l+1) = geopot(ij,l) + (g*kappa)*rhodz(ij,l)*theta(ij,l)*exner_ik/p_ik 509 pk(ij,l) = exner_ik 510 ENDDO 511 ENDDO 512 DO ij=ij_begin_ext,ij_end_ext 513 p_ik = pk(ij,l) 514 exner_ik = cpp * (p_ik/preff) ** kappa 515 geopot(ij,l+1) = geopot(ij,l) + (g*kappa)*rhodz(ij,l)*theta(ij,l)*exner_ik/p_ik 516 pk(ij,l) = exner_ik 517 ENDDO 518 ENDDO 519 ENDIF 512 520 END IF 513 521 514 522 END IF 523 524 !ym flush geopot 525 !$OMP BARRIER 515 526 516 527 CALL trace_end("compute_geopot") … … 799 810 CALL trace_start("compute_caldyn_vert") 800 811 801 ! !$OMP BARRIER812 !$OMP BARRIER 802 813 !!! cumulate mass flux convergence from top to bottom 803 DO l = llm-1, 1, -1 814 IF (is_omp_level_master) THEN 815 DO l = llm-1, 1, -1 804 816 ! IF (caldyn_conserv==energy) CALL test_message(req_qu) 805 817 806 818 !!$OMP DO SCHEDULE(STATIC) 807 819 !DIR$ SIMD 808 DO ij=ij_begin,ij_end 809 convm(ij,l) = convm(ij,l) + convm(ij,l+1) 820 DO ij=ij_begin,ij_end 821 convm(ij,l) = convm(ij,l) + convm(ij,l+1) 822 ENDDO 810 823 ENDDO 811 ENDDO 812 813 ! IMPLICIT FLUSH on convm 824 ENDIF 825 826 !$OMP BARRIER 827 ! FLUSH on convm 814 828 !!!!!!!!!!!!!!!!!!!!!!!!! 815 829 816 830 ! compute dps 817 IF ( omp_first) THEN831 IF (is_omp_first_level) THEN 818 832 !DIR$ SIMD 819 833 DO ij=ij_begin,ij_end … … 834 848 ENDDO 835 849 850 !--> flush wflux 851 !$OMP BARRIER 852 836 853 DO l=ll_begin,ll_endm1 837 854 !DIR$ SIMD … … 847 864 ENDDO 848 865 ENDDO 866 849 867 850 868 ! Compute vertical transport … … 859 877 860 878 !--> flush wwuu 861 ! !$OMP BARRIER879 !$OMP BARRIER 862 880 863 881 ! Add vertical transport to du … … 1018 1036 ps = f_ps(ind) 1019 1037 p = f_p(ind) 1038 !$OMP BARRIER 1020 1039 CALL compute_pression(ps,p,0) 1021 1040 pk = f_pk(ind) 1022 1041 pks = f_pks(ind) 1042 !$OMP BARRIER 1023 1043 CALL compute_exner(ps,p,pks,pk,0) 1044 !$OMP BARRIER 1024 1045 theta_rhodz = f_theta_rhodz(ind) 1025 1046 theta = f_theta(ind)
Note: See TracChangeset
for help on using the changeset viewer.