Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix for MG array allocation PR #291 #293

Merged
merged 10 commits into from
Aug 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion physics/cs_conv.F90
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,13 @@ subroutine cs_conv_run(IM , IJSDIM , KMAX , ntracp1 , NN, &
real(r8), intent(inout), dimension(IJSDIM,KMAX) :: ud_mf, dd_mf, dt_mf

real(r8), intent(out) :: rain1(IJSDIM) ! lwe thickness of deep convective precipitation amount (m)
real(r8), intent(out), dimension(ijsdim,kmax) :: qlcn, qicn, w_upi,cnv_mfd, &
! GJF* These variables are conditionally allocated depending on whether the
! Morrison-Gettelman microphysics is used, so they must be declared
! using assumed shape.
real(r8), intent(out), dimension(:,:) :: qlcn, qicn, w_upi,cnv_mfd, &
cnv_dqldt, clcn, cnv_fice, &
cnv_ndrop, cnv_nice, cf_upi
! *GJF
integer, intent(inout) :: kcnv(im) ! zero if no deep convection and 1 otherwise
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down
8 changes: 5 additions & 3 deletions physics/docs/ccpplatex_dox
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = YES
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = .f=FortranFree \
EXTENSION_MAPPING = .F=FortranFree \
.f=FortranFree \
.F90=FortranFree \
.f90=FortranFree
MARKDOWN_SUPPORT = YES
Expand Down Expand Up @@ -175,7 +176,8 @@ INPUT = pdftxt/mainpage.txt \
../funcphys.f90 \
../physparam.f \
../physcons.f90 \
../radcons.f90
../radcons.f90 \
../machine.F

INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.f \
Expand All @@ -187,7 +189,7 @@ EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATH = .
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH = img
Expand Down
16 changes: 13 additions & 3 deletions physics/m_micro.F90
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,16 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i &
& lwheat_i,swheat_i
real (kind=kind_phys), dimension(ix,0:lm),intent(in):: prsi_i, &
& phii
real (kind=kind_phys), dimension(im,lm),intent(in) :: &
! GJF* These variables are conditionally allocated depending on whether the
! Morrison-Gettelman microphysics is used, so they must be declared
! using assumed shape.
real (kind=kind_phys), dimension(:,:), intent(in) :: &
& CNV_DQLDT_i, CLCN_i, QLCN_i, QICN_i, &
& CNV_MFD_i, cf_upi, CNV_FICE_i, CNV_NDROP_i, &
& CNV_NICE_i, w_upi, rhc_i, naai_i, npccn_i
& CNV_NICE_i, w_upi
! *GJF
real (kind=kind_phys), dimension(im,lm),intent(in) :: &
& rhc_i, naai_i, npccn_i
real (kind=kind_phys), dimension(im,lm,ntrcaer),intent(in) :: &
& aerfld_i
real (kind=kind_phys),dimension(im),intent(in):: TAUGWX, &
Expand All @@ -320,9 +326,13 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i &
integer, dimension(IM), intent(inout):: KCBL
real (kind=kind_phys),dimension(ix,lm),intent(inout):: q_io, t_io, &
& ncpl_io,ncpi_io,CLLS_io
real (kind=kind_phys),dimension(im,lm),intent(inout):: rnw_io,snw_io,&
! GJF* These variables are conditionally allocated depending on whether the
! Morrison-Gettelman microphysics is used, so they must be declared
! using assumed shape.
real (kind=kind_phys),dimension(:,:),intent(inout):: rnw_io,snw_io,&
& ncpr_io, ncps_io, &
& qgl_io, ncgl_io
! *GJF
!Moo real (kind=kind_phys),dimension(im,lm),intent(inout):: CLLS_io


Expand Down
24 changes: 1 addition & 23 deletions physics/ozphys.f
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,7 @@ end subroutine ozphys_finalize
!! Research Laboratory through CHEM2D chemistry model
!! (McCormack et al. (2006) \cite mccormack_et_al_2006).
!! \section arg_table_ozphys_run Argument Table
!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional |
!! |----------------|---------------------------------------------------------------------------|----------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------|
!! | ix | horizontal_dimension | horizontal dimension | count | 0 | integer | | in | F |
!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F |
!! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F |
!! | ko3 | vertical_dimension_of_ozone_forcing_data | number of vertical layers in ozone forcing data | count | 0 | integer | | in | F |
!! | dt | time_step_for_physics | physics time step | s | 0 | real | kind_phys | in | F |
!! | oz | ozone_concentration_updated_by_physics | ozone concentration updated by physics | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | tin | air_temperature_updated_by_physics | updated air temperature | K | 2 | real | kind_phys | in | F |
!! | po3 | natural_log_of_ozone_forcing_data_pressure_levels | natural log of ozone forcing data pressure levels | log(Pa) | 1 | real | kind_phys | in | F |
!! | prsl | air_pressure | mid-layer pressure | Pa | 2 | real | kind_phys | in | F |
!! | prdout | ozone_forcing | ozone forcing coefficients | various | 3 | real | kind_phys | in | F |
!! | oz_coeff | number_of_coefficients_in_ozone_forcing_data | number of coefficients in ozone forcing data | index | 0 | integer | | in | F |
!! | delp | air_pressure_difference_between_midlayers | difference between mid-layer pressures | Pa | 2 | real | kind_phys | in | F |
!! | ldiag3d | flag_diagnostics_3D | flag for calculating 3-D diagnostic fields | flag | 0 | logical | | in | F |
!! | ozp1 | cumulative_change_in_ozone_concentration_due_to_production_and_loss_rate | cumulative change in ozone concentration due to production and loss rate | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | ozp2 | cumulative_change_in_ozone_concentration_due_to_ozone_mixing_ratio | cumulative change in ozone concentration due to ozone mixing ratio | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | ozp3 | cumulative_change_in_ozone_concentration_due_to_temperature | cumulative change in ozone concentration due to temperature | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | ozp4 | cumulative_change_in_ozone_concentration_due_to_overhead_ozone_column | cumulative change in ozone concentration due to overhead ozone column | kg kg-1 | 2 | real | kind_phys | inout | F |
!! | con_g | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F |
!! | me | mpi_rank | rank of the current MPI task | index | 0 | integer | | in | F |
!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F |
!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F |
!! \htmlinclude ozphys_run.html
!!
!> \section genal_ozphys GFS ozphys_run General Algorithm
!> @{
Expand Down
194 changes: 194 additions & 0 deletions physics/ozphys.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
[ccpp-arg-table]
name = ozphys_init
type = scheme

########################################################################
climbfuji marked this conversation as resolved.
Show resolved Hide resolved
[ccpp-arg-table]
name = ozphys_finalize
type = scheme

########################################################################
[ccpp-arg-table]
name = ozphys_run
type = scheme
[ix]
standard_name = horizontal_dimension
long_name = horizontal dimension
units = count
dimensions = ()
type = integer
intent = in
optional = F
[im]
standard_name = horizontal_loop_extent
long_name = horizontal loop extent
units = count
dimensions = ()
type = integer
intent = in
optional = F
[levs]
standard_name = vertical_dimension
long_name = number of vertical layers
units = count
dimensions = ()
type = integer
intent = in
optional = F
[ko3]
standard_name = vertical_dimension_of_ozone_forcing_data
long_name = number of vertical layers in ozone forcing data
units = count
dimensions = ()
type = integer
intent = in
optional = F
[dt]
standard_name = time_step_for_physics
long_name = physics time step
units = s
dimensions = ()
type = real
kind = kind_phys
intent = in
optional = F
[oz]
standard_name = ozone_concentration_updated_by_physics
long_name = ozone concentration updated by physics
units = kg kg-1
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[tin]
standard_name = air_temperature_updated_by_physics
long_name = updated air temperature
units = K
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[po3]
standard_name = natural_log_of_ozone_forcing_data_pressure_levels
long_name = natural log of ozone forcing data pressure levels
units = log(Pa)
dimensions = (vertical_dimension_of_ozone_forcing_data)
type = real
kind = kind_phys
intent = in
optional = F
[prsl]
standard_name = air_pressure
long_name = mid-layer pressure
units = Pa
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[prdout]
standard_name = ozone_forcing
long_name = ozone forcing coefficients
units = various
dimensions = (horizontal_dimension,vertical_dimension_of_ozone_forcing_data,number_of_coefficients_in_ozone_forcing_data)
type = real
kind = kind_phys
intent = in
optional = F
[oz_coeff]
standard_name = number_of_coefficients_in_ozone_forcing_data
long_name = number of coefficients in ozone forcing data
units = index
dimensions = ()
type = integer
intent = in
optional = F
[delp]
standard_name = air_pressure_difference_between_midlayers
long_name = difference between mid-layer pressures
units = Pa
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[ldiag3d]
standard_name = flag_diagnostics_3D
long_name = flag for calculating 3-D diagnostic fields
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[ozp1]
standard_name = cumulative_change_in_ozone_concentration_due_to_production_and_loss_rate
long_name = cumulative change in ozone concentration due to production and loss rate
units = kg kg-1
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[ozp2]
standard_name = cumulative_change_in_ozone_concentration_due_to_ozone_mixing_ratio
long_name = cumulative change in ozone concentration due to ozone mixing ratio
units = kg kg-1
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[ozp3]
standard_name = cumulative_change_in_ozone_concentration_due_to_temperature
long_name = cumulative change in ozone concentration due to temperature
units = kg kg-1
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[ozp4]
standard_name = cumulative_change_in_ozone_concentration_due_to_overhead_ozone_column
long_name = cumulative change in ozone concentration due to overhead ozone column
units = kg kg-1
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[con_g]
standard_name = gravitational_acceleration
long_name = gravitational acceleration
units = m s-2
dimensions = ()
type = real
kind = kind_phys
intent = in
optional = F
[me]
standard_name = mpi_rank
long_name = rank of the current MPI task
units = index
dimensions = ()
type = integer
intent = in
optional = F
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
units = none
dimensions = ()
type = character
kind = len=*
intent = out
optional = F
[errflg]
standard_name = ccpp_error_flag
long_name = error flag for error handling in CCPP
units = flag
dimensions = ()
type = integer
intent = out
optional = F
Loading