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

Specific water species handling from physics_update needs to be implemented #139

Open
cacraigucar opened this issue Oct 17, 2024 · 0 comments

Comments

@cacraigucar
Copy link
Collaborator

Inside of CAM's version of physics_update, there are two sections which impact water species, but have not been implemented in CAM-SIMA yet. These sections are:

          ! don't call qneg3 for number concentration variables
          if (m /= ixnumice  .and.  m /= ixnumliq .and. &
              m /= ixnumrain .and.  m /= ixnumsnow ) then
             call qneg3(trim(ptend%name), state%lchnk, ncol, state%psetcols, pver, m, m, qmin(m:m), state%q(:,1:pver,m:m))
          else
             do k = ptend%top_level, ptend%bot_level
                ! checks for number concentration
                state%q(:ncol,k,m) = max(1.e-12_r8,state%q(:ncol,k,m))
                state%q(:ncol,k,m) = min(1.e10_r8,state%q(:ncol,k,m))
             end do
          end if
    ! Enforce a minimum non-zero value.
    if (ixcldliq > 1) then
       if(ptend%lq(ixcldliq)) then
#ifdef PERGRO
          if ( any(ptend%name == pergro_cldlim_names) ) &
               call state_cnst_min_nz(1.e-12_r8, ixcldliq, ixnumliq)
#endif
          if ( any(ptend%name == cldlim_names) ) &
               call state_cnst_min_nz(1.e-36_r8, ixcldliq, ixnumliq)
       end if
    end if
    if (ixcldice > 1) then
       if(ptend%lq(ixcldice)) then
#ifdef PERGRO
          if ( any(ptend%name == pergro_cldlim_names) ) &
               call state_cnst_min_nz(1.e-12_r8, ixcldice, ixnumice)
#endif
          if ( any(ptend%name == cldlim_names) ) &
               call state_cnst_min_nz(1.e-36_r8, ixcldice, ixnumice)
       end if
    end if

Without these changes, a test run of ZM code using snapshots generated with the unaltered physics_update code gives the following differences:

 Variable                                          # Diffs  Max Diff   Max Diff loc (rank, col, lev)
 --------                                          -------  --------   -----------------------------
 air_temperature                                      1279  0.22E-15   (0,383,25)                                                   
 geopotential_height_wrt_surface                      1647  0.44E-15   (0,427,29)                                                   
 geopotential_height_wrt_surface_at_interface         1612  0.43E-15   (0,429,31)                                                   
 tendency_of_air_temperature_due_to_model_physics     2041  0.95E-15   (0,324,26)                                                   
 cnst_NUMICE                                          6548  0.30E-11   (0,36,28)                                                    
cloud_ice_mixing_ratio_wrt_moist_air_and_condensed_water
                                                       660  0.96E-36   (0,134,32)                                                   
water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water
                                                       790  0.30E-15   (0,146,29)                                                   
 cnst_NUMLIQ                                          9700  0.11E-09   (0,126,29)                                                   
 cnst_NUMSNO                                          5463  0.10E-11   (0,31,26)                                                    
 cnst_NUMRAI                                          6023  0.32E-13   (0,141,21)                                                   
cloud_liquid_water_mixing_ratio_wrt_moist_air_and_condensed_water
                                                      7072  0.10E-35   (0,45,21)                                                    
 ********** End Physics Check Data Results **********


With the above three sections of code commented out in the CAM run which made the snapshot files, the identical ZM code gives the following differences:

  Variable                                          # Diffs  Max Diff   Max Diff loc (rank, col, lev)
 --------                                          -------  --------   -----------------------------
 air_temperature                                      1248  0.22E-15   (0,419,26)                                                   
 geopotential_height_wrt_surface                      1858  0.44E-15   (0,7,27)                                                     
 geopotential_height_wrt_surface_at_interface         1813  0.44E-15   (0,440,31)                                                   
 tendency_of_air_temperature_due_to_model_physics     2109  0.11E-14   (0,47,23)                                                    
water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water
                                                       706  0.35E-15   (0,271,30)                                                   
                                             
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant