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 source codes for the repair job #77

Merged
merged 10 commits into from
Sep 24, 2024

Conversation

HongGuan-NOAA
Copy link
Contributor

Description

Add the repair source code into the gfs-utils. This source code is needed for the repair job. Global-workflow PR #2838 depends on this PR.

Type of change

  • New feature (adds functionality)

Change characteristics

  • Is this a breaking change (a change in existing functionality)? NO
  • Does this change require a documentation update? NO

How has this been tested?

Checklist

  • Any dependent changes have been merged and published
  • 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
  • My changes generate no new warnings
  • New and existing tests pass with my changes
  • I have made corresponding changes to the documentation if necessary

Copy link
Contributor

@aerorahul aerorahul left a comment

Choose a reason for hiding this comment

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

some minor comments that are hopefully very easy to fix.

@@ -0,0 +1,538 @@
program gefs_6h_ave_1mem
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a f90 code, so it does not need to have 6 spaces. The modern compiler will understand.

Comment on lines 125 to 126
call get_environment_variable("file_dir", file_dir)
call get_environment_variable("out_dir", out_dir)
Copy link
Contributor

Choose a reason for hiding this comment

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

please lets not use environment variables. Either use a namelist or command-line argument.

@@ -0,0 +1,286 @@
subroutine prlevel(ipdtn,ipdtmpl,labbrev)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this prlevel.f90

@HongGuan-NOAA
Copy link
Contributor Author

HongGuan-NOAA commented Sep 16, 2024 via email

@aerorahul
Copy link
Contributor

I have fixed the first two comments. Not sure what you mean for the last comment "can we make this prlevel.f90". Thanks!

On Fri, Sep 13, 2024 at 9:39 PM Rahul Mahajan @.> wrote: @.* requested changes on this pull request. some minor comments that are hopefully very easy to fix. ------------------------------ In src/gefs_6h_ave_1mem.fd/gefs_6h_ave_1mem.f90 <#77 (comment)>: > @@ -0,0 +1,538 @@ + program gefs_6h_ave_1mem This is a f90 code, so it does not need to have 6 spaces. The modern compiler will understand. ------------------------------ In src/gefs_6h_ave_1mem.fd/gefs_6h_ave_1mem.f90 <#77 (comment)>: > + call get_environment_variable("file_dir", file_dir) + call get_environment_variable("out_dir", out_dir) please lets not use environment variables. Either use a namelist or command-line argument. ------------------------------ In src/gefs_6h_ave_1mem.fd/prlevel.f <#77 (comment)>: > @@ -0,0 +1,286 @@ + subroutine prlevel(ipdtn,ipdtmpl,labbrev) Can we make this prlevel.f90 — Reply to this email directly, view it on GitHub <#77 (review)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVLBRUT7WKT53I356MBOKXTZWOHWJAVCNFSM6AAAAABM6X2MB6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGMBUGM2DKNBXGM . You are receiving this because you authored the thread.Message ID: @.***>

Thanks @HongGuan-NOAA
I meant to just rename the file prlevel.f90 and unindent the code

Comment on lines 151 to 155
if( ifh == 003 ) then
datafile(nfi)=trim(datapath)//'gefs.t00z.master.grb2f'//trim(sfh) ! only control data avail
else
datafile(nfi)=trim(datapath)//'gefs.t00z.master.grb2f'//trim(sfh)
endif
Copy link
Contributor

Choose a reason for hiding this comment

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

the if and else are identical

Comment on lines 170 to 184
if (nfi /= 3 ) then
jpdtn = pdt%npdt(ifid) !template version num.
jpdt(1) = pdt%icat(ifid)
jpdt(2) = pdt%iprm(ifid)
jpdt(10) = pdt%iffs(ifid)
jdisc = disc(ifid)
else
! ifid1=ifid + nfield1/2
jpdtn =11 !template version num.
jpdt(1) = pdt%icat(ifid)
jpdt(2) = pdt%iprm(ifid)
jpdt(10) = pdt%iffs(ifid)
jdisc = disc(ifid)
!! if (ifid ==14 ) jpdt(10) = 10
endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Line 171 and 178 are the only conditional dependent here. There others can be outside the if-else structure.

@HongGuan-NOAA
Copy link
Contributor Author

HongGuan-NOAA commented Sep 16, 2024 via email

Copy link
Contributor

@EricSinsky-NOAA EricSinsky-NOAA left a comment

Choose a reason for hiding this comment

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

I think you can remove some of the commented code, otherwise it looks good.

Comment on lines 311 to 314
! if (var_save(i,1).gt.1.E20.and.var_save(i,3).gt.1.E20) var_save_acc(i)=var_save(i,3)
! if (var_save(i,1).gt.1.E20.and.var_save(i,3).lt.1.E20) var_save_acc(i)=var_save(i,3)
! if (var_save(i,1).lt.1.E20.and.var_save(i,3).gt.1.E20) var_save_acc(i)=var_save(i,1)
! if (var_save(i,1).lt.1.E20.and.var_save(i,3).lt.1.E20) then
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can remove these commented lines.

!output 6h variables

!reasign gfldo%fld
! gfldo%fld=var_save_acc(:)
Copy link
Contributor

Choose a reason for hiding this comment

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

This commented code can be removed.

@HongGuan-NOAA
Copy link
Contributor Author

HongGuan-NOAA commented Sep 17, 2024 via email

@WalterKolczynski-NOAA
Copy link
Contributor

@HongGuan-NOAA Have you made any progress building with the newer g2 library? We have been using 3.4.5 since we moved code to this separate repository, so at least two years.

@HongGuan-NOAA
Copy link
Contributor Author

HongGuan-NOAA commented Sep 23, 2024 via email

@EricSinsky-NOAA
Copy link
Contributor

@HongGuan-NOAA Have you tried building with g2 3.4.5 on other platforms such as Hera?

@HongGuan-NOAA
Copy link
Contributor Author

HongGuan-NOAA commented Sep 23, 2024 via email

@HongGuan-NOAA
Copy link
Contributor Author

HongGuan-NOAA commented Sep 23, 2024 via email

@HongGuan-NOAA
Copy link
Contributor Author

HongGuan-NOAA commented Sep 24, 2024 via email

Copy link
Contributor

@aerorahul aerorahul left a comment

Choose a reason for hiding this comment

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

looks good.

@aerorahul aerorahul merged commit b9b9653 into NOAA-EMC:develop Sep 24, 2024
3 checks passed
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