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

implementation of forcing multifile feature #1214

Conversation

raphaeldussin
Copy link

@raphaeldussin raphaeldussin commented May 5, 2023

Description

This implements a new feature allowing to optionally use 3 consecutive forcing files, specified in data_table
hence making the padding of forcing files (adding last record of previous year and first record of following year)
unnecessary in interannual ice/ocean forced runs. Co-authored by @MJHarrison-GFDL

How Has This Been Tested?

Tested on c5 against a reference JRA run using the padded forcing files. After a one year common
spin-up, the run with padded files and the run with the new multifile feature reproduce bitwise.
This shows that the "bridging" from the previous year and following year worked as expected.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

@raphaeldussin raphaeldussin force-pushed the feature_data_override_multifile branch from 2c22035 to 9ac594f Compare May 10, 2023 20:06
@raphaeldussin raphaeldussin force-pushed the feature_data_override_multifile branch from 9ac594f to a7c9cdf Compare May 10, 2023 20:33
@raphaeldussin raphaeldussin marked this pull request as ready for review July 5, 2023 17:31
Copy link
Member

@thomas-robinson thomas-robinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add documentation to the code and rename any variables that are named with Fortran keywords (ie. data)

@@ -1009,6 +1016,271 @@ subroutine time_interp_external_0d(index, time, data, verbose)

end subroutine time_interp_external_0d


subroutine time_interp_external_bridge_2d(index1, index2, time, data_in, interp, verbose,horz_interp, mask_out, &
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new routines all need to be documented with doxygen comments describing what they are for and what they do.

subroutine time_interp_external_bridge_2d(index1, index2, time, data_in, interp, verbose,horz_interp, mask_out, &
is_in, ie_in, js_in, je_in, window_id)

integer, intent(in) :: index1, index2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the new variables need to be documented with doxygen comments describing what they are


integer, intent(in) :: index1, index2
type(time_type), intent(in) :: time
real, dimension(:,:), intent(inout) :: data_in
Copy link
Member

@thomas-robinson thomas-robinson Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module will be updated to support both r4 and r8 in the near future (it's already in the process), so these real variables will need to be done in that style.

@mlee03 can you provide guidence on this to @raphaeldussin

Copy link
Contributor

@mlee03 mlee03 Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this PR is going to be approved and merged into main soon, we can put in the mixed-precision updates. Else, we've already changed time_interp to include mixed precision capabilities and perhaps it would be easier to start off from the time_interp_external2.inc file in the mixedmode branch. If possible, most of the mixed-precision updates (including data_override) will be merged in to the main branch by end of August and it would be simpler to wait until that merge before the changes here are included. One thing to note is the file structures have been reorganized significantly with the mixed-precision updates and this PR will require more work to be compatible with main then. What do you think?


integer, intent(in) :: index1, index2
type(time_type), intent(in) :: time
real, dimension(:,:,:), intent(inout) :: data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable needs to be renamed

real , dimension(size(data_in,1), size(data_in,2), 1) :: data_out
logical, dimension(size(data_in,1), size(data_in,2), 1) :: mask3d

data_out(:,:,1) = data_in(:,:) ! fill initial values for the portions of array that are not touched by 3d routine
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the input data always contiguous? If yes, can this be done using pointer rank remapping instead of making a copy?

call time_interp_external_bridge_3d(index1, index2, time, data_out, interp, verbose, horz_interp, mask3d, &
is_in=is_in,ie_in=ie_in,js_in=js_in,je_in=je_in,window_id=window_id)
data_in(:,:) = data_out(:,:,1)
if (PRESENT(mask_out)) mask_out(:,:) = mask3d(:,:,1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be remapped and you wouldn't need to do this (I think)

nikizadehgfdl added a commit to nikizadehgfdl/FMS that referenced this pull request Nov 14, 2023
- Raphael Dussin implementation of bridge/multifile feature for data_override
- This commit is basically Raphs branch raphaeldussin:feature_data_override_multifile
  merged with the main branch of FMS in PR NOAA-GFDL#1214
- Due to restructure of time_interp and data_override dirs in FMS2023.03
  I could not (did not know how to) do this merge via git and had to
  extract the mods from that PR and apply them to the main branch.
- Does not change answers.
@nikizadehgfdl
Copy link
Contributor

Replaced by #1408 . Closing.

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

Successfully merging this pull request may close these issues.

4 participants