Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

What and where is located the subroutine to generate all the log files in CESM?

nuvolet

Toni Viudez
Member
What version of the code are you using?
CESM2.2.2 in Derecho

Have you made any changes to files in the source tree?
Some modification in nudging module

Describe your problem or question:

What and where is located the subroutine that generates all the log files?..

Thanks
 

peverley

Courtney Peverley
Moderator
Staff member
Hi Toni,

Are you trying to write output to atm.log.* from your modified file?

If so, you'll just need to add a statement like:

if (masterproc) then
write(iulog,*) "YOUR STRING OR VARIABLE HERE"
end if

You can find other examples of this within the nudging.F90 module.

If that's not what you're asking, please let me know! There is no one module/routine that generates the log files.
Courtney
 
Vote Upvote 0 Downvote

nuvolet

Toni Viudez
Member
Hi Toni,

Are you trying to write output to atm.log.* from your modified file?

If so, you'll just need to add a statement like:



You can find other examples of this within the nudging.F90 module.

If that's not what you're asking, please let me know! There is no one module/routine that generates the log files.
Courtney
Hi Courtney,

I want to know is that when all the log files are generated which statements as you indicate as example go to atm.log or cess.log.

Thanks

Toni
 
Vote Upvote 0 Downvote

peverley

Courtney Peverley
Moderator
Staff member
Ah, gotcha!

Any write statements that are written on the masterproc will end up in the atm log (in CAM; the same is true for other components but it'll go to the corresponding log file). Logs on other tasks will be written to the cesm log.

So, if you want something to appear in the atm log, you'll include the block I referenced earlier:

if (masterproc) then
<write statement(s)>
end if

If your module doesn't already have the necessary use statements, you'll also need:
use spmd_utils, only: masterproc
use cam_logfile, only: iulog

Hope that helps!
Courtney
 
Vote Upvote 0 Downvote

nuvolet

Toni Viudez
Member
Ah, gotcha!

Any write statements that are written on the masterproc will end up in the atm log (in CAM; the same is true for other components but it'll go to the corresponding log file). Logs on other tasks will be written to the cesm log.

So, if you want something to appear in the atm log, you'll include the block I referenced earlier:



If your module doesn't already have the necessary use statements, you'll also need:


Hope that helps!
Courtney
This is helpful.

Thanks :)
 
Vote Upvote 0 Downvote
Top