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 option to write diagnostics from balance operator #1106

Open
3 tasks
travissluka opened this issue Dec 12, 2024 · 5 comments
Open
3 tasks

Add option to write diagnostics from balance operator #1106

travissluka opened this issue Dec 12, 2024 · 5 comments
Assignees
Labels
SOCA Sea-ice, Ocean, and Coupled Assimilation

Comments

@travissluka
Copy link
Collaborator

Description

Add an option to the balance operator linvarchange to write out the Jacobians and evaluate how they look

(See what was done in the old BkgErrGodas lin variable change

call self%std_bkgerr%write_file(str)
)

  • add option to save the T/S and SSH/TS Jacobians
  • save example diagnostics for several different months of the year (it would be good to capture NH summer/winter)
  • take a look and see if things look reasonable
@travissluka travissluka added the SOCA Sea-ice, Ocean, and Coupled Assimilation label Dec 12, 2024
@Dooruk
Copy link

Dooruk commented Dec 18, 2024

Is there an example for writing netcdf files in SOCA without defining the type as soca_fields? Because I can't use write_file for jacobians otherwise. I couldn't find via code search.

For instance, in your bkgerr pointer:

  type(soca_fields)                 :: std_bkgerr

@travissluka
Copy link
Collaborator Author

travissluka commented Dec 18, 2024

Is there an example for writing netcdf files in SOCA without defining the type as soca_fields? Because I can't use write_file for jacobians otherwise. I couldn't find via code search.

For instance, in your bkgerr pointer:

type(soca_fields) :: std_bkgerr

ah yes, one of the downsides of our soca IO, this is one of my motivations for refactoring things into C++/native-atlas fieldsets, it's easy to dump out any arbitrary atlas fieldset on the C++ side. You could

  1. use netcdf calls to create a file yourself (chatgpt might be able to easily to this for you!) or
  2. still use soca_fields so that you can use the soca io, if you want new variable names, you can add whatever you want to the field_metadata yaml file

@Dooruk
Copy link

Dooruk commented Dec 18, 2024

Ok thanks! I guess it depends on if you want this as a more permanent feature to be used among other balance, so I could even add it as a method/module, or is it like a one off time while we fix things. I will try both ways.

@travissluka
Copy link
Collaborator Author

Ok thanks! I guess it depends on if you want this as a more permanent feature to be used among other balance, so I could even add it as a method/module, or is it like a one off time while we fix things. I will try both ways.

yeah, I'd say do whatever is fastest for you. It's in the plans to refactor all this into a C++ saber outer block

@Dooruk
Copy link

Dooruk commented Dec 20, 2024

So, I want to go with the soca_fields route to have dimensions in the jac_out output file. When I add this part i get the following error.

  type(soca_field), pointer :: tocn, socn, hocn, cice, mld, layer_depth
  type(soca_fields) :: jac_out

.
.
.
    ! optionally write out Kst Jacobian
    if( f_conf%has("jacobian_output")) then
      call f_conf%get_or_die("jacobian_output.filename", str)
      call self%jac_out%copy(self%kst%jacobian)
      ! call self%kst%jacobian%write_file(str)
    end if

This is not a component name that is defined in the encompassing structure. [JAC_OUT] call self%jac_out%initialize()

Which is confusing because I'm solely replicating what was done for std_bkgerr. I don't see any specific changes for std_bkgerr to work in the past SOCA versions, what am I missing?

Sorry, I'm not a JEDI Academy attendee so bear with my simple questions. I'm one level below Padawan if that exists 😄 Happy to have brief chats over these type of minor issues if you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SOCA Sea-ice, Ocean, and Coupled Assimilation
Projects
None yet
Development

No branches or pull requests

2 participants