-
Notifications
You must be signed in to change notification settings - Fork 153
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
add ccpp_compliant ozphys_2015.f #160
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b69b6d2
ozphys_2015.f
mzhangw 49fb209
add ccpp-compliant ozphys_2015.f
mzhangw 102a248
seperate diag%dq3dt(:,:6:9)
mzhangw ada85a4
clean up codes
mzhangw 1b162e2
Merge branch 'master' of https://github.com/NCAR/ccpp-physics into oz…
mzhangw 23294fb
codes cleanup
mzhangw 1935234
calculate gravi out of loop per Grant's suggestion and clean up code.
mzhangw c30a657
Merge branch 'ozphys2015' of https://github.com/mzhangw/ccpp-physics …
mzhangw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,53 +29,60 @@ 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 data | 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 | | ||
!! | ozp | change_in_ozone_concentration | change in ozone concentration | kg kg-1 | 3 | real | kind_phys | inout | 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 | | ||
!! | 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 | | ||
!! | ||
!> \section genal_ozphys GFS ozphys_run General Algorithm | ||
!! @{ | ||
subroutine ozphys_run ( & | ||
& ix, im, levs, ko3, dt, oz, tin, po3, & | ||
& prsl, prdout, oz_coeff, delp, ldiag3d, & | ||
& ozp, me, errmsg, errflg) | ||
& ozp1, ozp2, ozp3, ozp4, con_g, me, errmsg, errflg) | ||
! | ||
! this code assumes that both prsl and po3 are from bottom to top | ||
! as are all other variables | ||
! | ||
use machine , only : kind_phys | ||
use physcons, only : grav => con_g | ||
implicit none | ||
! | ||
! Interface variables | ||
integer, intent(in) :: im, ix, levs, ko3, oz_coeff, me | ||
real(kind=kind_phys), intent(inout) :: & | ||
& oz(ix,levs), ozp(ix,levs,oz_coeff) | ||
& oz(ix,levs), & | ||
& ozp1(ix,levs), ozp2(ix,levs), ozp3(ix,levs), & | ||
& ozp4(ix,levs) | ||
real(kind=kind_phys), intent(in) :: & | ||
& dt, po3(ko3), prdout(ix,ko3,oz_coeff), & | ||
& prsl(ix,levs), tin(ix,levs), delp(ix,levs) | ||
& prsl(ix,levs), tin(ix,levs), delp(ix,levs), & | ||
& con_g | ||
real :: gravi | ||
logical, intent(in) :: ldiag3d | ||
|
||
character(len=*), intent(out) :: errmsg | ||
integer, intent(out) :: errflg | ||
! | ||
! Local variables | ||
real, parameter :: gravi=1.0/grav | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could have just removed the ", parameter" statement and used real :: gravi =1.0/grav but that's not worth requesting an additional change. Leave it like it is. |
||
integer k,kmax,kmin,l,i,j | ||
logical flg(im) | ||
real(kind=kind_phys) pmax, pmin, tem, temp | ||
|
@@ -88,13 +95,14 @@ subroutine ozphys_run ( & | |
! | ||
! save input oz in ozi | ||
ozi = oz | ||
gravi=1.0/con_g | ||
! | ||
!> - Calculate vertical integrated column ozone values. | ||
if (oz_coeff > 2) then | ||
colo3(:,levs+1) = 0.0 | ||
do l=levs,1,-1 | ||
do i=1,im | ||
colo3(i,l) = colo3(i,l+1) + ozi(i,l) * delp(i,l) * gravi | ||
colo3(i,l) = colo3(i,l+1) + ozi(i,l) * delp(i,l) * gravi | ||
enddo | ||
enddo | ||
endif | ||
|
@@ -156,16 +164,16 @@ subroutine ozphys_run ( & | |
! | ||
if (ldiag3d) then ! ozone change diagnostics | ||
do i=1,im | ||
ozp(i,l,1) = ozp(i,l,1) + prod(i,1)*dt | ||
ozp(i,l,2) = ozp(i,l,2) + (oz(i,l) - ozib(i)) | ||
ozp1(i,l) = ozp1(i,l) + prod(i,1)*dt | ||
ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) | ||
enddo | ||
endif | ||
endif | ||
!> - Calculate the 4 terms of prognostic ozone change during time \a dt: | ||
!! - ozp(:,:,1) - Ozone production at model layers | ||
!! - ozp(:,:,2) - Ozone tendency at model layers | ||
!! - ozp(:,:,3) - Ozone production from temperature term at model layers | ||
!! - ozp(:,:,4) - Ozone production from column ozone term at model layers | ||
!! - ozp1(:,:) - Ozone production from production/loss ratio | ||
!! - ozp2(:,:) - Ozone production from ozone mixing ratio | ||
!! - ozp3(:,:) - Ozone production from temperature term at model layers | ||
!! - ozp4(:,:) - Ozone production from column ozone term at model layers | ||
if (oz_coeff == 4) then | ||
do i=1,im | ||
ozib(i) = ozi(i,l) ! no filling | ||
|
@@ -177,10 +185,10 @@ subroutine ozphys_run ( & | |
enddo | ||
if (ldiag3d) then ! ozone change diagnostics | ||
do i=1,im | ||
ozp(i,l,1) = ozp(i,l,1) + prod(i,1)*dt | ||
ozp(i,l,2) = ozp(i,l,2) + (oz(i,l) - ozib(i)) | ||
ozp(i,l,3) = ozp(i,l,3) + prod(i,3)*tin(i,l)*dt | ||
ozp(i,l,4) = ozp(i,l,4) + prod(i,4)*colo3(i,l+1)*dt | ||
ozp1(i,l) = ozp1(i,l) + prod(i,1)*dt | ||
ozp2(i,l) = ozp2(i,l) + (oz(i,l) - ozib(i)) | ||
ozp3(i,l) = ozp3(i,l) + prod(i,3)*tin(i,l)*dt | ||
ozp4(i,l) = ozp4(i,l) + prod(i,4)*colo3(i,l+1)*dt | ||
enddo | ||
endif | ||
endif | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this, Man!