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

Please help with debugging (mpi issue) - help with writing diagnostics to log file as code executes (not field list)

marcinkupilas

Marcin Kupilas
New Member
Hello

Thanks in advance for your time.

I am running cesm2.2.0 and trying to write out a variable to the atm.log file from the gw_drag module. I only wish to know its values for a single vertical column (exact location doesn't matter), and the code that I have written at the end of the module is:

IF (masterproc) then
do k = 1, pver
write (iulog,*) variable(5,k)
enddo
ENDIF

where the variable is defined as variable(ncol, pver) where ncol=5 an arbitrarily chosen column ID and pver is the vertical level ID.

I was under the impression that the master processor has information of all of the variables, meaning I can pick any point in the atmosphere on any other processor, and the master processor will print it out to the log file. What I get however is this statement printed out 22 times.

I have recently learnt that the issue could be with domain decomposition and how the dimensions are defined, where every processor has a number of chunks ("lchnk"), and each chunk has it's own ncol list, and so what appears to be happening is that the master processor has 22 chunks, and each chunk has an ncol = 5.

Best wishes
Marcin
 

peverley

Courtney Peverley
Moderator
Hi Marcin,

Apologies if this is an obvious question, but is it possible that pver is 22? Since you're looping over pver, your print statement is being written pver times. If you want to instead print out the full column (with one print statement), you can skip the do loop and just print out everything for the 5th column like this:

IF (masterproc) then
write(iulog,*) variable(5,:)
endif

Also, you will get these print statements every timestep.

If this isn't the issue and the question above is irrelevant, can you provide the compset and resolution you are using in addition to the variable you are trying to print out? I assume you're adding the print code to the end of gw_tend, where I wouldn't expect it to be impacted by chunking.

Courtney
 
Top