Changeset 913 for codes/icosagcm/devel/src
- Timestamp:
- 06/17/19 17:38:58 (5 years ago)
- Location:
- codes/icosagcm/devel/src
- Files:
-
- 16 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/src/base/init_grid_param.f90
r906 r913 3 3 USE compute_diagnostics_mod 4 4 USE compute_rhodz_mod 5 USE compute_pression_mod 5 6 6 7 USE compute_caldyn_mod … … 57 58 58 59 SUBROUTINE select_compute_hex 59 compute_rhodz => compute_rhodz_hex 60 compute_pvort_only => compute_pvort_only_hex 60 ! diagnostics 61 compute_rhodz => compute_rhodz_hex 62 compute_pression => compute_pression_hex 63 compute_pression_mid => compute_pression_mid_hex 64 ! dynamics 65 compute_pvort_only => compute_pvort_only_hex 61 66 END SUBROUTINE select_compute_hex 62 67 63 68 SUBROUTINE select_compute_unst 64 compute_rhodz => compute_rhodz_unst 65 compute_pvort_only => compute_pvort_only_unst 69 ! diagnostics 70 compute_rhodz => compute_rhodz_unst 71 compute_pression => compute_pression_unst 72 compute_pression_mid => compute_pression_mid_unst 73 ! dynamics 74 compute_pvort_only => compute_pvort_only_unst 66 75 END SUBROUTINE select_compute_unst 67 76 -
codes/icosagcm/devel/src/diagnostics/check_conserve.f90
r908 r913 1 1 MODULE check_conserve_mod 2 2 USE icosa 3 USE compute_pression_mod, ONLY : pression 3 4 IMPLICIT NONE 4 5 5 PRIVATE 6 6 … … 52 52 53 53 SUBROUTINE check_conserve(f_ps,f_dps,f_ue,f_theta_rhodz,f_phis,it) 54 USE pression_mod55 54 USE vorticity_mod 56 55 USE caldyn_gcm_mod … … 129 128 130 129 IF(check_type == check_detailed) THEN 131 !ang_mass = AAM_mass-AAM_mass_old132 !WRITE(*,'(A,3E12.4)') 'AAM_mass sanity check', SUM(AAM_mass_source), ang_mass, SUM(AAM_mass_source)-ang_mass133 !ang_vel = AAM_vel-AAM_vel_old134 !WRITE(*,'(A,3E12.4)') 'AAM_vel sanity check', SUM(AAM_vel_source), ang_vel, SUM(AAM_vel_source)-ang_vel135 130 WRITE(*,'(A,6E14.6)') 'AAM_mass : time,old,new,dissip,dyn,phys', dt*it, AAM_mass_old, AAM_mass, & 136 131 AAM_mass_source(AAM_dissip), AAM_mass_source(AAM_dyn), AAM_mass_source(AAM_phys) … … 158 153 159 154 SUBROUTINE check_conserve_detailed(it,tag, f_ps,f_dps,f_ue,f_theta_rhodz,f_phis) 160 USE pression_mod161 155 USE vorticity_mod 162 156 USE caldyn_gcm_mod … … 196 190 ! ang_XXX = value of total AAM_XXX now 197 191 ! AAM_XXX_source(tag) = source of AAA_XXX due to tag=dissip,dyn,phys 198 !WRITE(*,'(A,3E12.2)') 'AAM_mass', tag, ang_mass, AAM_mass, ang_mass-AAM_mass ! FIXME199 !WRITE(*,'(A,3E12.2)') 'AAM_vel ', tag, ang_vel, AAM_vel, ang_vel-AAM_vel ! FIXME200 192 AAM_mass_source(tag) = AAM_mass_source(tag) + ang_mass - AAM_mass 201 193 AAM_vel_source(tag) = AAM_vel_source(tag) + ang_vel - AAM_vel … … 276 268 SUBROUTINE check_energy(f_ue,f_theta_rhodz,f_phis, etot, & 277 269 stot, AAM_mass_tot, AAM_vel_tot, AAM_velp_tot, AAM_velm_tot, rmsvtot) 278 USE pression_mod279 270 USE vorticity_mod 280 271 TYPE(t_field), POINTER :: f_ue(:) -
codes/icosagcm/devel/src/diagnostics/compute_diagnostics.f90
r906 r913 12 12 END SUBROUTINE comp_rhodz 13 13 14 SUBROUTINE comp_pression(ps, p, offset) 15 USE prec, ONLY : rstd 16 INTEGER, INTENT(IN) :: offset 17 REAL(rstd), INTENT(IN) :: ps(1) 18 REAL(rstd), INTENT(OUT) :: p(1,1) 19 END SUBROUTINE comp_pression 14 20 END INTERFACE 15 21 16 22 PROCEDURE(comp_rhodz), POINTER :: compute_rhodz 23 PROCEDURE(comp_pression), POINTER :: compute_pression, compute_pression_mid 17 24 18 25 END MODULE compute_diagnostics_mod -
codes/icosagcm/devel/src/diagnostics/compute_pression.F90
r905 r913 1 MODULE pression_mod 1 MODULE compute_pression_mod 2 USE compute_diagnostics_mod 3 USE icosa 4 USE omp_para 5 USE disvert_mod, ONLY : ap, bp, ap_bp_present 6 IMPLICIT NONE 7 PRIVATE 8 9 #include "../unstructured/unstructured.h90" 10 11 PUBLIC :: pression, compute_pression_hex, compute_pression_unst, & 12 pression_mid, compute_pression_mid_hex, compute_pression_mid_unst 2 13 3 14 CONTAINS 4 15 16 #ifdef BEGIN_DYSL 17 18 {%- macro compute_pression(llmax)%} 19 {%- set inner_loop=caller() %} 20 {%- set llmax="'%s'"%llmax %} 21 IF(ap_bp_present) THEN 22 IF(offset>0) THEN 23 FORALL_CELLS_EXT('1',{{ llmax }}) 24 ON_PRIMAL 25 {{ inner_loop }} 26 END_BLOCK 27 END_BLOCK 28 ELSE 29 FORALL_CELLS('1',{{ llmax }}) 30 ON_PRIMAL 31 {{ inner_loop }} 32 END_BLOCK 33 END_BLOCK 34 END IF 35 END IF 36 {%- endmacro %} 37 38 KERNEL(compute_pression) 39 {% call compute_pression('llm+1') %} 40 p(CELL) = AP(CELL) + BP(CELL) * ps(HIDX(CELL)) 41 {% endcall %} 42 END_BLOCK 43 44 KERNEL(compute_pmid) 45 {% call compute_pression('llm') %} 46 pmid(CELL) = .5*(AP(CELL)+AP(UP(CELL)) + (BP(CELL)+BP(UP(CELL))) * ps(HIDX(CELL)) ) 47 {% endcall %} 48 END_BLOCK 49 50 #endif END_DYSL 51 5 52 SUBROUTINE pression(f_ps,f_p) 6 USE icosa7 IMPLICIT NONE8 53 TYPE(t_field), POINTER :: f_ps(:) 9 54 TYPE(t_field), POINTER :: f_p(:) … … 27 72 28 73 SUBROUTINE pression_mid(f_ps,f_pmid) 29 USE icosa30 IMPLICIT NONE31 74 TYPE(t_field), POINTER :: f_ps(:) 32 75 TYPE(t_field), POINTER :: f_pmid(:) … … 49 92 END SUBROUTINE pression_mid 50 93 51 SUBROUTINE compute_pression(ps,p,offset) 52 USE icosa 53 USE disvert_mod 54 USE omp_para 55 IMPLICIT NONE 94 !------------- hexagonal-mesh compute kernels -------- 95 96 #define AP(ij,l) ap(l) 97 #define BP(ij,l) bp(l) 98 99 SUBROUTINE compute_pression_hex(ps,p,offset) 56 100 REAL(rstd),INTENT(IN) :: ps(iim*jjm) 57 101 REAL(rstd),INTENT(OUT) :: p(iim*jjm,llm+1) 58 102 INTEGER,INTENT(IN) :: offset 59 INTEGER :: i,j,ij,l 60 61 IF(ap_bp_present) THEN 62 DO l = ll_begin, ll_endp1 63 ! DO l = 1, llm + 1 64 DO j=jj_begin-offset,jj_end+offset 65 DO i=ii_begin-offset,ii_end+offset 66 ij=(j-1)*iim+i 67 p(ij,l) = ap(l) + bp(l) * ps(ij) 68 ENDDO 69 ENDDO 70 ENDDO 71 END IF 72 73 END SUBROUTINE compute_pression 103 INTEGER :: ij,l 104 #include "../kernels_hex/compute_pression.k90" 105 END SUBROUTINE compute_pression_hex 74 106 75 SUBROUTINE compute_pression_mid(ps,pmid,offset) 76 USE icosa 77 USE disvert_mod 78 USE omp_para 79 IMPLICIT NONE 107 SUBROUTINE compute_pression_mid_hex(ps,pmid,offset) 80 108 REAL(rstd),INTENT(IN) :: ps(iim*jjm) 81 109 REAL(rstd),INTENT(OUT) :: pmid(iim*jjm,llm) 82 110 INTEGER,INTENT(IN) :: offset 83 INTEGER :: i,j,ij,l 111 INTEGER :: ij,l 112 #include "../kernels_hex/compute_pmid.k90" 113 END SUBROUTINE compute_pression_mid_hex 84 114 85 IF(ap_bp_present) THEN 86 DO l = ll_begin, ll_end 87 DO j=jj_begin-offset,jj_end+offset 88 DO i=ii_begin-offset,ii_end+offset 89 ij=(j-1)*iim+i 90 pmid(ij,l) = 0.5*(ap(l)+ap(l+1) + (bp(l)+bp(l+1)) * ps(ij)) 91 ENDDO 92 ENDDO 93 ENDDO 94 END IF 115 #undef AP 116 #undef BP 95 117 96 END SUBROUTINE compute_pression_mid 118 !----------- unstructured-mesh compute kernels -------- 97 119 98 END MODULE pression_mod 120 #define AP(l,ij) ap(l) 121 #define BP(l,ij) bp(l) 122 123 SUBROUTINE compute_pression_unst(ps, p, offset) 124 FIELD_PS, INTENT(IN) :: ps 125 FIELD_GEOPOT, INTENT(OUT) :: p 126 INTEGER, INTENT(IN) :: offset 127 DECLARE_INDICES 128 #include "../kernels_unst/compute_pression.k90" 129 END SUBROUTINE compute_pression_unst 130 131 SUBROUTINE compute_pression_mid_unst(ps, pmid, offset) 132 FIELD_PS, INTENT(IN) :: ps 133 FIELD_MASS, INTENT(OUT) :: pmid 134 INTEGER, INTENT(IN) :: offset 135 DECLARE_INDICES 136 #include "../kernels_unst/compute_pmid.k90" 137 END SUBROUTINE compute_pression_mid_unst 138 139 #undef AP 140 #undef BP 141 142 END MODULE compute_pression_mod -
codes/icosagcm/devel/src/diagnostics/exner.f90
r533 r913 1 1 MODULE exner_mod 2 USE icosa 3 IMPLICIT NONE 4 PRIVATE 5 SAVE 2 6 3 INTEGER ,SAVE:: caldyn_exner7 INTEGER :: caldyn_exner 4 8 !$OMP THREADPRIVATE(caldyn_exner) 5 9 6 10 INTEGER, PARAMETER :: lmdz=3, direct=4 11 12 PUBLIC :: exner, compute_exner 7 13 8 14 CONTAINS 9 15 10 16 SUBROUTINE exner(f_ps,f_p,f_pks,f_pk) 11 USE icosa12 IMPLICIT NONE13 17 TYPE(t_field), POINTER :: f_ps(:) ! IN 14 18 TYPE(t_field), POINTER :: f_p(:) ! IN … … 38 42 39 43 SUBROUTINE compute_exner(ps,p,pks,pk,offset) 40 USE icosa 41 USE disvert_mod 42 USE pression_mod 43 USE omp_para 44 IMPLICIT NONE 44 USE disvert_mod 45 USE omp_para 45 46 REAL(rstd),INTENT(IN) :: ps(iim*jjm) 46 47 REAL(rstd),INTENT(IN) :: p(iim*jjm,llm+1) -
codes/icosagcm/devel/src/diagnostics/geopotential_mod.f90
r533 r913 9 9 USE icosa 10 10 USE omp_para 11 USE pression_mod11 USE compute_diagnostics_mod, ONLY : compute_pression 12 12 USE theta2theta_rhodz_mod 13 13 TYPE(t_field), POINTER :: f_ps(:), f_phis(:), f_theta_rhodz(:), & ! IN -
codes/icosagcm/devel/src/diagnostics/observable.f90
r906 r913 43 43 USE xios_mod 44 44 USE earth_const 45 USE pression_mod45 USE compute_pression_mod, ONLY : pression_mid 46 46 USE vertical_interp_mod 47 47 USE theta2theta_rhodz_mod … … 295 295 SUBROUTINE diagnose_temperature(f_pmid,f_q,f_temp) 296 296 USE icosa 297 USE pression_mod298 297 IMPLICIT NONE 299 298 TYPE(t_field), POINTER :: f_pmid(:) ! IN … … 319 318 SUBROUTINE compute_diagnose_temp(pmid,q,temp) 320 319 USE omp_para 321 USE pression_mod322 320 REAL(rstd),INTENT(IN) :: pmid(iim*jjm,llm) 323 321 REAL(rstd),INTENT(IN) :: q(iim*jjm,llm,nqtot) -
codes/icosagcm/devel/src/diagnostics/theta_rhodz.f90
r533 r913 1 1 MODULE theta2theta_rhodz_mod 2 USE icosa 2 3 USE field_mod 4 USE compute_diagnostics_mod 5 IMPLICIT NONE 3 6 PRIVATE 7 4 8 TYPE(t_field), POINTER, SAVE :: f_p(:) 5 9 … … 12 16 13 17 SUBROUTINE init_theta2theta_rhodz 14 USE icosa15 USE field_mod16 IMPLICIT NONE17 18 CALL allocate_field(f_p,field_t,type_real,llm+1,name='p (theta2theta_rhodz_mod)') 18 19 END SUBROUTINE init_theta2theta_rhodz … … 20 21 21 22 SUBROUTINE theta_rhodz2theta(f_ps,f_theta_rhodz,f_theta) 22 USE icosa23 IMPLICIT NONE24 23 TYPE(t_field), POINTER :: f_ps(:) 25 24 TYPE(t_field), POINTER :: f_theta_rhodz(:) … … 46 45 47 46 SUBROUTINE theta_rhodz2temperature(f_ps,f_theta_rhodz,f_temp) 48 USE icosa49 USE pression_mod50 IMPLICIT NONE51 47 TYPE(t_field), POINTER :: f_ps(:) 52 48 TYPE(t_field), POINTER :: f_theta_rhodz(:) … … 78 74 79 75 SUBROUTINE temperature2theta_rhodz(f_ps,f_temp,f_theta_rhodz) 80 USE icosa81 USE pression_mod82 76 USE exner_mod 83 77 IMPLICIT NONE … … 113 107 114 108 SUBROUTINE theta2theta_rhodz(f_ps,f_theta,f_theta_rhodz) 115 USE icosa116 IMPLICIT NONE117 109 TYPE(t_field), POINTER :: f_ps(:) 118 110 TYPE(t_field), POINTER :: f_theta(:) … … 139 131 140 132 SUBROUTINE compute_theta2theta_rhodz(ps,theta, theta_rhodz,offset) 141 USE icosa142 133 USE disvert_mod 143 134 USE omp_para 144 IMPLICIT NONE145 135 REAL(rstd),INTENT(IN) :: ps(iim*jjm) 146 136 REAL(rstd),INTENT(IN) :: theta(iim*jjm,llm) … … 166 156 167 157 SUBROUTINE compute_theta_rhodz2theta(ps,theta_rhodz,theta,offset) 168 USE icosa169 158 USE disvert_mod 170 159 USE omp_para 171 IMPLICIT NONE172 160 REAL(rstd),INTENT(IN) :: ps(iim*jjm) 173 161 REAL(rstd),INTENT(IN) :: theta_rhodz(iim*jjm,llm) … … 198 186 199 187 SUBROUTINE compute_theta_rhodz2temperature(p,theta_rhodz,temp,offset) 200 USE icosa201 USE pression_mod202 188 USE exner_mod 203 189 USE omp_para 204 IMPLICIT NONE205 190 REAL(rstd),INTENT(IN) :: p(iim*jjm,llm+1) 206 191 REAL(rstd),INTENT(IN) :: theta_rhodz(iim*jjm,llm) … … 227 212 228 213 SUBROUTINE compute_temperature2theta_rhodz(p,temp,theta_rhodz,offset) 229 USE icosa230 USE pression_mod231 214 USE exner_mod 232 215 USE omp_para 233 IMPLICIT NONE234 216 REAL(rstd),INTENT(IN) :: p(iim*jjm,llm+1) 235 217 REAL(rstd),INTENT(OUT) :: theta_rhodz(iim*jjm,llm) -
codes/icosagcm/devel/src/dissip/nudging_mod.f90
r886 r913 147 147 USE transfert_mod 148 148 USE time_mod 149 USE pression_mod150 149 REAL(rstd), INTENT(IN):: tt 151 150 TYPE(t_field),POINTER :: f_ps(:) -
codes/icosagcm/devel/src/dissip/sponge.f90
r533 r913 89 89 USE icosa 90 90 USE theta2theta_rhodz_mod 91 USE pression_mod92 91 USE exner_mod 93 92 USE geopotential_mod -
codes/icosagcm/devel/src/initial/etat0_academic.f90
r531 r913 76 76 USE icosa 77 77 USE disvert_mod 78 USE pression_mod78 USE compute_diagnostics_mod, ONLY : compute_pression 79 79 USE exner_mod 80 80 USE geopotential_mod -
codes/icosagcm/devel/src/initial/etat0_database.f90
r726 r913 1 1 MODULE etat0_database_mod 2 IMPLICIT NONE 2 3 3 4 … … 7 8 USE xios_mod 8 9 USE omp_para 9 IMPLICIT NONE10 10 11 11 IF (is_omp_master) THEN … … 27 27 USE theta2theta_rhodz_mod 28 28 USE qsat_mod 29 USE pression_mod29 USE compute_pression_mod, ONLY : pression 30 30 USE omp_para 31 IMPLICIT NONE32 31 TYPE(t_field),POINTER :: f_ps(:) 33 32 TYPE(t_field),POINTER :: f_phis(:) -
codes/icosagcm/devel/src/kernels_unst/theta.k90
r878 r913 17 17 !DIR$ SIMD 18 18 DO l = 1, llm 19 ! FIXME : formula below (used in DYNAMICO) is for dak, dbk based on pressure rather than mass 19 ! FIXME : formula below (used in DYNAMICO) is for dak, dbk based on 20 ! pressure rather than mass 20 21 ! m = mass_dak(l,ij)+(mass_col(ij)*g+ptop)*mass_dbk(l,ij) 21 22 ! rhodz(l,ij) = m/g -
codes/icosagcm/devel/src/physics/physics.f90
r741 r913 284 284 SUBROUTINE pack_physics(info, phis, geopot, ps, temp, ue, q, p, pk, ulon, ulat ) 285 285 USE wind_mod 286 USE pression_mod286 USE compute_diagnostics_mod 287 287 USE theta2theta_rhodz_mod 288 288 USE exner_mod -
codes/icosagcm/devel/src/physics/physics_lmdz_generic.F90
r584 r913 461 461 462 462 SUBROUTINE grid_icosa_to_physics 463 USE pression_mod464 463 USE exner_mod 465 464 USE theta2theta_rhodz_mod -
codes/icosagcm/devel/src/vertical/vertical_interp.f90
r531 r913 1 1 MODULE vertical_interp_mod 2 2 USE icosa 3 USE omp_para 4 USE compute_diagnostics_mod 5 IMPLICIT NONE 3 6 PRIVATE 4 7 … … 10 13 CONTAINS 11 14 12 SUBROUTINE init_vertical_interp 13 USE icosa 14 IMPLICIT NONE 15 15 SUBROUTINE init_vertical_interp 16 16 ! CALL allocate_field(f_p,field_t,type_real,llm+1) 17 18 17 END SUBROUTINE init_vertical_interp 19 18 20 19 SUBROUTINE vertical_interp(f_pmid,f_in,f_out,pval) 21 USE icosa22 USE pression_mod23 USE omp_para24 IMPLICIT NONE25 20 TYPE(t_field),POINTER :: f_pmid(:) 26 21 TYPE(t_field),POINTER :: f_in(:) … … 47 42 48 43 SUBROUTINE compute_vertical_interp(pmid,in,out,pval) 49 USE omp_para50 IMPLICIT NONE51 44 REAL(rstd),INTENT(IN) :: pmid(iim*jjm,llm) 52 45 REAL(rstd),INTENT(IN) :: in(iim*jjm,llm) -
codes/icosagcm/devel/src/vertical/vertical_remap.f90
r530 r913 1 1 MODULE vertical_remap_mod 2 2 USE icosa 3 3 USE omp_para 4 IMPLICIT NONE 5 PRIVATE 6 7 PUBLIC :: vertical_remap 4 8 5 9 CONTAINS … … 7 11 8 12 SUBROUTINE vertical_remap(pressure_level,field_in,f_ps,field_out) 9 USE icosa 10 USE pression_mod 11 USE omp_para 12 IMPLICIT NONE 13 USE compute_pression_mod, ONLY : pression 13 14 REAL(rstd), INTENT(IN) :: pressure_level(:) 14 15 TYPE(t_field),POINTER :: field_in(:) … … 39 40 40 41 SUBROUTINE compute_vertical_remap(pressure_level,in,p,out) 41 USE omp_para42 IMPLICIT NONE43 42 REAL(rstd),INTENT(IN) :: pressure_level(:) 44 43 REAL(rstd),INTENT(IN) :: in(:,:)
Note: See TracChangeset
for help on using the changeset viewer.