Skip to content

fix inconsistent types related with noahmp and log functions#755

Merged
climbfuji merged 2 commits into
NCAR:mainfrom
uturuncoglu:hotfix/data_types
Nov 3, 2021
Merged

fix inconsistent types related with noahmp and log functions#755
climbfuji merged 2 commits into
NCAR:mainfrom
uturuncoglu:hotfix/data_types

Conversation

@uturuncoglu
Copy link
Copy Markdown
Contributor

@uturuncoglu uturuncoglu commented Oct 8, 2021

This PR aims to fix couple of minor issue related to the inconsistent data types in the CCPP/physics. If user wants to compile NoahMP and related files outside of the CCPP package, the compiler triggers errors since some of the subroutines uses real data type rather than real(kind=kind_phys), which kind_phys is set to R8 by default under CCPP.

This is related with the following issue: #750

Copy link
Copy Markdown
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

Thanks for these bug fixes. I think that they won't impact the UFS at all, because the files you are changing are compiled with default double precision reals in the UFS.

@climbfuji
Copy link
Copy Markdown
Collaborator

@uturuncoglu I tested these changes, and I get compile errors (with Intel, haven't triedd GNU yet):

ifort: command line remark #10120: overriding '-O0' with '-O1'
ifort: warning #10182: disabling optimization; runtime debug checks enabled
/glade/work/heinzell/fv3/ufs-weather-model/ufs-weather-model-develop-20210929-cleanup-ccpp/intel/FV3/ccpp/physics/physics/sflx.f(3997): error #5082: Syntax error, found '&' when expecting one of: :: ) , : * <END-OF-STATEMENT> ; . (/ + - ] /) ' ** / // > PRIVATE ...
            df = log( (psis*gs2/lsubf) * ( (1.0 + ck*swl)**2.0 )      &
----------------------------------------------------------------------^
compilation aborted for /glade/work/heinzell/fv3/ufs-weather-model/ufs-weather-model-develop-20210929-cleanup-ccpp/intel/FV3/ccpp/physics/physics/sflx.f (code 1)
make[2]: *** [FV3/ccpp/physics/CMakeFiles/ccpp_physics.dir/physics/sflx.f.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [FV3/ccpp/physics/CMakeFiles/ccpp_physics.dir/all] Error 2
make: *** [all] Error 2

Copy link
Copy Markdown
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

Please fix the compile errors.

@uturuncoglu
Copy link
Copy Markdown
Contributor Author

@climbfuji sure. it is probably due to the line continuation. I need to move it to the next line.

@uturuncoglu
Copy link
Copy Markdown
Contributor Author

@climbfuji btw, I am also using intel but compiling those sources did not reveal any issue. ccpp might use different flags than I am using.

@climbfuji
Copy link
Copy Markdown
Collaborator

@climbfuji btw, I am also using intel but compiling those sources did not reveal any issue. ccpp might use different flags than I am using.

Good point. I think there are some hardcoded form flags for certain files. Generally, .f/.F files should be fixed form, .f90/.F90 files free form.

@uturuncoglu
Copy link
Copy Markdown
Contributor Author

@climbfuji I think I fixed it it was spacing issue. The & need to be at column 73. How can I test it. I think If I compile the UFS, it will show up. Right?

@climbfuji
Copy link
Copy Markdown
Collaborator

Thanks, Ufuk! The code now compiles with both 32bit and 64bit fv3atm (physics is always 64bit in the UFS). I pulled your PR into #752. Please keep your PR open, it should be flagged as merged (and you of course get all the credit for it) when #752 gets merged (a week or longer from now). Thanks again for catching and fixing those problems.

@uturuncoglu
Copy link
Copy Markdown
Contributor Author

@climbfuji I confirmed that control_noahmp RT test passes without any issue. Thanks for catching that.

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.

2 participants