- Timestamp:
- 07/16/19 01:46:14 (5 years ago)
- Location:
- codes/icosagcm/devel/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/src/base/init_grid_param.f90
r955 r958 5 5 USE compute_pression_mod 6 6 USE compute_temperature_mod 7 USE vertical_interp_mod 7 8 8 9 USE compute_caldyn_mod … … 71 72 compute_temperature => compute_temperature_hex 72 73 compute_hydrostatic_pressure => compute_hydrostatic_pressure_hex 74 compute_vertical_interp => compute_vertical_interp_hex 73 75 ! dynamics 74 76 compute_pvort_only => compute_pvort_only_hex … … 87 89 compute_temperature => compute_temperature_unst 88 90 compute_hydrostatic_pressure => compute_hydrostatic_pressure_unst 91 compute_vertical_interp => compute_vertical_interp_unst 89 92 ! dynamics 90 93 compute_pvort_only => compute_pvort_only_unst -
codes/icosagcm/devel/src/diagnostics/compute_diagnostics.f90
r955 r958 39 39 END SUBROUTINE comp_hydro_press 40 40 41 SUBROUTINE comp_vert_interp(pmid,in,out,pval) 42 IMPORT 43 REAL(rstd),INTENT(IN) :: pmid(iim_jjm_i, llm_) 44 REAL(rstd),INTENT(IN) :: in(iim_jjm_i, llm_) 45 REAL(rstd),INTENT(OUT):: out(iim_jjm_i) 46 REAL(rstd),INTENT(IN) :: pval 47 END SUBROUTINE comp_vert_interp 48 41 49 END INTERFACE 42 50 … … 45 53 PROCEDURE(comp_temperature), POINTER :: compute_temperature => NULL() 46 54 PROCEDURE(comp_hydro_press), POINTER :: compute_hydrostatic_pressure => NULL() 55 PROCEDURE(comp_vert_interp), POINTER :: compute_vertical_interp => NULL() 47 56 48 PUBLIC :: compute_rhodz, compute_pression, compute_pression_mid, compute_temperature, compute_hydrostatic_pressure 57 PUBLIC :: compute_rhodz, compute_pression, compute_pression_mid, compute_temperature, compute_hydrostatic_pressure, & 58 compute_vertical_interp 49 59 50 60 END MODULE compute_diagnostics_mod -
codes/icosagcm/devel/src/vertical/vertical_interp.f90
r913 r958 9 9 10 10 11 PUBLIC init_vertical_interp, vertical_interp, compute_vertical_interp 11 PUBLIC init_vertical_interp, vertical_interp, & 12 compute_vertical_interp_hex, compute_vertical_interp_unst 12 13 13 14 CONTAINS … … 41 42 END SUBROUTINE vertical_interp 42 43 43 SUBROUTINE compute_vertical_interp (pmid,in,out,pval)44 SUBROUTINE compute_vertical_interp_hex(pmid,in,out,pval) 44 45 REAL(rstd),INTENT(IN) :: pmid(iim*jjm,llm) 45 46 REAL(rstd),INTENT(IN) :: in(iim*jjm,llm) 46 REAL(rstd),INTENT(OUT) 47 REAL(rstd) :: pval, coeff48 INTEGER :: i,j,ij ,l47 REAL(rstd),INTENT(OUT):: out(iim*jjm) 48 REAL(rstd),INTENT(IN) :: pval 49 INTEGER :: i,j,ij 49 50 50 51 !$OMP BARRIER … … 54 55 DO i=ii_begin-1,ii_end+1 55 56 ij=(j-1)*iim+i 56 l=llm-1 57 DO WHILE(pmid(ij,l)<pval .AND. l>1) 58 l=l-1 59 ENDDO 60 coeff=(pval-pmid(ij,l))/(pmid(ij,l)-pmid(ij,l+1)) 61 out(ij)=in(ij,l)+coeff*(in(ij,l)-in(ij,l+1)) 57 CALL interp_1d(pmid(ij,:), in(ij,:), out(ij), pval) 62 58 ENDDO 63 59 ENDDO … … 65 61 !$OMP BARRIER 66 62 67 END SUBROUTINE compute_vertical_interp 63 END SUBROUTINE compute_vertical_interp_hex 64 65 SUBROUTINE compute_vertical_interp_unst(pmid,in,out,pval) 66 REAL(rstd),INTENT(IN) :: pmid(llm, primal_num) 67 REAL(rstd),INTENT(IN) :: in(llm, primal_num) 68 REAL(rstd),INTENT(OUT) :: out(primal_num) 69 REAL(rstd) :: pval 70 INTEGER :: ij 71 !$OMP BARRIER 72 !$OMP MASTER 73 DO ij=1, primal_num 74 CALL interp_1d(pmid(:,ij), in(:,ij), out(ij), pval) 75 END DO 76 !$OMP END MASTER 77 !$OMP BARRIER 78 END SUBROUTINE compute_vertical_interp_unst 79 80 PURE SUBROUTINE interp_1d(pmid,in,out,pval) 81 REAL(rstd),INTENT(IN) :: pmid(:) 82 REAL(rstd),INTENT(IN) :: in(:) 83 REAL(rstd),INTENT(OUT) :: out 84 REAL(rstd),INTENT(IN) :: pval 85 REAL(rstd) :: coeff 86 INTEGER :: l 87 l=llm-1 88 DO WHILE(pmid(l)<pval .AND. l>1) 89 l=l-1 90 END DO 91 coeff=(pval-pmid(l))/(pmid(l)-pmid(l+1)) 92 out=in(l)+coeff*(in(l)-in(l+1)) 93 END SUBROUTINE interp_1d 68 94 69 95 END MODULE vertical_interp_mod
Note: See TracChangeset
for help on using the changeset viewer.