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

Add constituent tendencies to diagnostics scheme #125

Open
peverwhee opened this issue Oct 2, 2024 · 0 comments
Open

Add constituent tendencies to diagnostics scheme #125

peverwhee opened this issue Oct 2, 2024 · 0 comments

Comments

@peverwhee
Copy link
Collaborator

Once #111 has been merged, we should add all the constituent tendencies to src/sima_diagnostics/sima_tend_diagnostics.F90 (and .meta)

The logic should be similar to the constituent logic in sima_state_diagnostics.F90 (loop over the constituent properties object and add the possible fields if the constituent is present):

init logic

! Add constituent fields
      const_num_found = 0
      do const_idx = 1, size(const_props)
         call const_props(const_idx)%standard_name(standard_name, errflg, errmsg)
         do name_idx = 1, size(const_std_names)
            if (trim(standard_name) == trim(const_std_names(name_idx))) then
               call history_add_field(trim(const_tend_diag_names(name_idx)), trim(const_std_names(name_idx)), 'lev', 'avg', 'kg kg-1', mixing_ratio='wet')
               const_num_found = const_num_found + 1
            end if
         end do
         if (const_num_found == size(const_std_names)) then
            exit
         end if
      end do

run logic

      ! Capture constituent fields
      const_num_found = 0
      do const_idx = 1, size(const_props)
         call const_props(const_idx)%standard_name(standard_name, errflg, errmsg)
         do name_idx = 1, size(const_std_names)
            if (trim(standard_name) == trim(const_std_names(name_idx))) then
               call history_out_field(trim(const_tend_diag_names(name_idx)), const_tend_array(:,:,const_idx))
               const_num_found = const_num_found + 1
            end if
         end do
         if (const_num_found == size(const_std_names)) then
            exit
         end if
      end do
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