<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" face="Monaco">Hi, Lex,</font><div><font class="Apple-style-span" face="Monaco"><br></font></div><div><font class="Apple-style-span" face="Monaco">If this error message "NC definations on multiprocesses conflict"</font></div><div><font class="Apple-style-span" face="Monaco">is the only one you got before every crash, it is most likely the</font></div><div><font class="Apple-style-span" face="Monaco">attribute values are not the same across all processes. </font></div><div><font class="Apple-style-span" face="Monaco">Please check that first, so you can rule out that possibility.</font></div><div><font class="Apple-style-span" face="Monaco"><br></font></div><div><font class="Apple-style-span" face="Monaco">Also, can you check the attributes in the output file for the case</font></div><div><font class="Apple-style-span" face="Monaco">that ran successfully? (using ncmpidump -c filename) This is just</font></div><div><font class="Apple-style-span" face="Monaco">to see if the attributes are the ones you expected. Also, please</font></div><div><font class="Apple-style-span" face="Monaco">make sure the number of attributes created is less than 4K global</font></div><div><font class="Apple-style-span" face="Monaco">or per variable, as Rob indicated.</font></div><div><font class="Apple-style-span" face="Monaco"><br></font></div><div><font class="Apple-style-span" face="Monaco">Wei-keng</font></div><div><font class="Apple-style-span" face="Monaco"><br></font></div><div><font class="Apple-style-span" face="Monaco"><br></font><div><div><font class="Apple-style-span" face="Monaco">On Feb 19, 2009, at 5:53 PM, Alex Hoffmann wrote:</font></div><font class="Apple-style-span" face="Monaco"><br></font><blockquote type="cite"><div><font class="Apple-style-span" face="Monaco">Dear Wei-keng,<br><br>I understand that the attribute define arguments must be the same across<br>all processes. I am also almost certain that the arguments you cited<br>are identical across processes but I will perform a check.<br><br>Be this as it may, I get the same arrow message if I uncomment one of<br>the text attributes specifying the unit or one of the real attributes<br>specifying the fill value, for instance. There is no possibility that<br>these are different across processes as they are introduced straight<br>into the function call. Any check I performed seemed to indicate that<br>the problem arises from the number of arguments I defined, and not from<br>the arguments themselves, since they work all fine individually.<br><br>I was actually thinking to write the attributes ad-hoc once the dataset<br>is defined using regular netCDF functions. This however seemed to be a<br>little elegant solution defeating the purpose of using PnetCDF.<br><br>Thanks,<br><br>Lex<br><br><br>Wei-keng Liao a écrit :<br></font><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Hi, Lex,<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">PnetCDF requires the attribute define arguments be the same across<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">all processes. This is why you got the error message for defining<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">attribute "history" in line 400, if its value "conflicts" among<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">processes.<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">I think you have got this.<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">I checked your codes. Starting from line 562, you have a few text<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">attributes<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">from des_tgas_picture(i), des_trac_picture(i), des_tpas_picture(i),<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">and des.<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Similar for out_type == 2. Are you sure their values are all the same<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">across<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">all the processes? May be you can use MPI_Bcast to check if anyone has<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">different value.<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Wei-keng<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco">On Feb 19, 2009, at 11:14 AM, Alex Hoffmann wrote:<br></font></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Dear Rob<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Thanks a lot for your answer.<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Isolating the PnetCDF output module from the code as a stand-alone would<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">require a substantial effort, and I do not encounter this error in my<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">small test programs. I attached the output module for reference.<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">The attribute section that causes trouble is between lines 369-405<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(global) and 468-613 (variables). I am aware that the attribute history<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(line 400) may be problematic as every process may have a slightly<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">different value (for the time element taken from the fortran function<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">date_and_time). Yet this is not the only issue.<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">If I prematurely exit at line 492, uncommenting any further attribute<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">definition between 468 and 489 causes a crash with the multiprocesses<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">conflict.<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Note also that the attribute definitions between 558 and 613 only<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">produce no crash currently because of the print statements on lines 560<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">and 591, which made me think that maybe there is an optimization<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">problem. What is strange is that if these are not included, the crash<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">occurs only when I start writing the first file (movie file,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">out_type=2), AND if I leave the first block (if out_type==1)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">uncommented, although this block is not even entered in that particular<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">case, and vice versa. Hope this is more or less clear...<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Cheers,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Lex<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Robert Latham wrote:<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">On Thu, Feb 19, 2009 at 10:09:37AM +0000, Alex Hoffmann wrote:<br></font></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Hello,<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">I am getting the same error message as had already been inquired on in<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">this list, i.e.:<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NC definations on multiprocesses conflict.<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NOTE: Definitions across all process<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">and this seems to be related somehow randomly to the total number of<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">attributes (global or for each variable) that I intend to write during<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">the the definition phase (and, though I am not sure about this, to the<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">number of processes used to run my F90 parallel code).<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">More precisely, if I uncomment one put_att to replace another, the<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">program still runs, if I do not comment out another one, the program<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">crashes with the above error message.<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Is there any way of identifying where this problem comes from or is<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">there a maximum amount of attributes (though I don't write an<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">excessive<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">amount of them)? There is no problem running it on one process(or).<br></font></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Maybe you can show us with a small test program how you are<br></font></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">encountering this error? The maximum number of attributes is 4k (the<br></font></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">constant NC_MAX_ATTRS).<br></font></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">==rob<br></font></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">-- <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">______________________________________________________________________<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Alex HOFFMANN PhD Candidate<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Centre for Atmospheric Science<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Department of Geography University of Cambridge<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">Downing Place, Cambridge CB2 3EN, UK<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">e-mail: <a href="mailto:ah519@cam.ac.uk">ah519@cam.ac.uk</a> tel: +44 (0)1223 766581<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><a href="http://www.geog.cam.ac.uk/people/hoffmann/">www.geog.cam.ac.uk/people/hoffmann/</a><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">______________________________________________________________________<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">!-*- F90 -*-<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">module atham_pnetcdf<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !--------------------------------------------------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! author: Alex HOFFMANN !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! email: <a href="mailto:ah519@cam.ac.uk">ah519@cam.ac.uk</a> !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! date: February 2009 !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! version: v0.1 !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! collection of routines for ATHAM PnetCDF output !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !--------------------------------------------------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! module is to replace existing atham_netcdf.mod (GL) to write ATHAM<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">output as netCDF files<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! same as atham_netcdf.mod (AH) but adapted to run with the Parallel<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NetCDF API,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! developed by Northwestern University and Argonne National Laboratory,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! which is built on top of MPI-IO (tested with MPICH 2.1)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">use precision, only : kint, kreal, real4, my_real<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">use atham_module, only : nx, ny, nz, ntx, nty, npx, npy<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">use atham_module, only : ntgas_picture, ntrac_picture, ntpas_picture, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ntgas_movie, ntrac_movie, ntpas_movie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">implicit none<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">private<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">public :: netcdf_data<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! 'pnetcdf.inc' file includes cpp directives that were not understood<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">at compile-time<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! this is to be changed and hard-wired link to be replaced by the<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">include 'pnetcdf.inc' command<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">!include 'pnetcdf.inc'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">#include "/usr/local/parallel-netcdf-1.0.1/include/pnetcdf.inc"<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">include 'mpif.h'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! ######### tried saving netCDF variable IDs here so that they must<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">not be retrieved by inquiry<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! ######### if this creates conflict, especially between picture and<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">movie file, this must be changed<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint), save :: x_dimID, y_dimID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">z_dimID, t_dimID<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint), save :: x_varID, y_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">z_varID, t_varID<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint), save :: u_varID, v_varID, w_varID<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint), save :: pnew_varID, tetnew_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">tempnew_varID, density_varID<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint), save :: turbhor_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">turbver_varID, turblen_varID<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint), dimension(99), save :: tgas_varID, trac_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">tpas_varID, d_trac_varID<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(MPI_OFFSET_KIND), save :: tcounter<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> real(real4), parameter :: undef = -0.99e33_real4 !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">make sure precision of _FillValue and output (NF90_FLOAT) is the same<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">!!!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">contains<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !=====================================================================<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> subroutine netcdf_data(outfile,out_type,timetot)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! IF: outfile = picture_file or movie_file (path/filename for<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">output created in atham_module)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! out_type = 1 (picture_file) or 2 (movie_file)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! timetot = total simulation time since simulation start<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : unew, vnew, wnew, pnew, tetnew, tempnew, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> density, turbhor, turbver, turblen<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : tgasnew, tracnew, tpasnew, tracdep<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : itgas_picture, itrac_picture,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">itpas_picture, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> itgas_movie, itrac_movie, itpas_movie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : mycoor, my_cart, myrank<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(*), intent(in ) :: outfile<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint), intent(in ) :: out_type<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> real(kreal), intent(in ) :: timetot<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !------------------------------------------------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! local variables !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !------------------------------------------------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(MPI_OFFSET_KIND) :: nx_mpi,ny_mpi, nz_mpi,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">y_cl_mpi<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(MPI_OFFSET_KIND) :: istart,jstart<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint) :: STATUS<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=50) :: OP ! debugging variable<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">corresponding to the called netCDF OPeration<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint) :: NCID<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint) :: i<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> logical :: DynMovie_flag,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">bounds_control<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint) :: y_st, y_sp, y_cl<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! replace DynMovie precompiler flag by program flag for more<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">convenient code structure<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> DynMovie_flag = .false.<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">#ifdef DynMovie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> DynMovie_flag = .true.<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">#endif<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! re-assign dimension lengths as an MPI_Offset type (necessary for<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">the PnetCDF interface)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! cut-off subdomain borders<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> nx_mpi = nx-2<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ny_mpi = ny-2<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> nz_mpi = nz<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! assign coordinates of first element of each process in the<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">netCDF file<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> istart = mycoor(1)*nx_mpi + 1_MPI_OFFSET_KIND<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> jstart = mycoor(2)*ny_mpi + 1_MPI_OFFSET_KIND<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> bounds_control = .true. ! debugging flag<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> tcounter = tcounter+1_MPI_OFFSET_KIND<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! === open netCDF dataset: enter data mode ------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! if dataset does not yet exist (STATUS = ), create file and<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">enter data mode<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! else continue<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'open existing netCDF file'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> STATUS = nfmpi_open(my_cart, trim(outfile), NF_WRITE,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">MPI_INFO_NULL, NCID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if ( STATUS /= nf_noerr ) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (myrank==0) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, ""<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, "P-NetCDF operation: ",trim(OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, trim(nfmpi_strerror(STATUS))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, "atham_pnetcdf netcdf_data(): new netCDF file<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">created: ", outfile<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, ""<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call netcdf_define(outfile,out_type,timetot,NCID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> tcounter = 1_MPI_OFFSET_KIND ! reset time counter for output if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">new file is created<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! --- write data values --------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! unlimited record dimension time (only one process writes the<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">whole dimension, i.e. accross all processes)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'write data values - unlimited dimension t'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_begin_indep_data(NCID))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (myrank==0) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_vara_real(NCID, t_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/tcounter/), (/1_MPI_OFFSET_KIND/), real(timetot,real4)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_end_indep_data(NCID))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! --- write data values --------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! discriminate between 2D and 3D case for output generation<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (nty>4) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> y_st = 2 ! y index start<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> y_sp = ny-1 ! y index stop<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> y_cl = ny-2 ! y number of columns<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> else<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> y_st = ny-1 ! 3 in 2D case<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> y_sp = ny-1 ! 3 in 2D case<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> y_cl = 1<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> y_cl_mpi = y_cl<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! dynamics data<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'write data values - data'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (out_type == 1 .OR. DynMovie_flag == .true.) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call write_data(real(unew,real4),u_varID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> bounds_control = .false.<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call write_data(real(vnew, real4),v_varID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call write_data(real(wnew, real4),w_varID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call write_data(real(pnew, real4),pnew_varID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call write_data(real(tetnew, real4),tetnew_varID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call write_data(real(tempnew,real4),tempnew_varID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call write_data(real(density,real4),density_varID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call write_data(real(turbhor,real4),turbhor_varID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call write_data(real(turbver,real4),turbver_varID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call write_data(real(turblen,real4),turblen_varID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! tracer data<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (out_type == 1) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntgas_picture<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">write_data(real(tgasnew(:,:,:,itgas_picture(i)),real4),tgas_varID(i))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntrac_picture<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">write_data(real(tracnew(:,:,:,itrac_picture(i)),real4),trac_varID(i))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntpas_picture<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">write_data(real(tpasnew(:,:,:,itpas_picture(i)),real4),tpas_varID(i))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntrac_picture<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_begin_indep_data(NCID))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_vara_real(NCID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">d_trac_varID(i),(/istart,jstart,tcounter/), &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> (/nx_mpi,y_cl_mpi,1_MPI_OFFSET_KIND/),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">real(reshape(tracdep(2:nx-1,y_st:y_sp,itrac_picture(i)),shape=(/nx-2,y_cl,1/)),real4)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_end_indep_data(NCID))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> else if (out_type == 2) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntgas_movie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">write_data(real(tgasnew(:,:,:,itgas_movie(i)),real4),tgas_varID(i))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntrac_movie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">write_data(real(tracnew(:,:,:,itrac_movie(i)),real4),trac_varID(i))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntpas_movie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">write_data(real(tpasnew(:,:,:,itpas_movie(i)),real4),tpas_varID(i))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> endif<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! === close netCDF dataset: exit data mode & save -----------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'close netCDF file'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_close(NCID))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (myrank==0) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, ''<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, 'wrote netCDF output to file ', outfile<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, ''<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> contains<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !----------------------------------------------------------------<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> subroutine write_data(array_in,varID)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! IF: array_in = data array (3D) to be written to netCDF<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! varID = data variable netCDF ID<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : iflgs ! topography mask: topography<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(iflgs=0) remains undef<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : myrank<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> real(real4),dimension(nx,ny,nz), intent (in ) :: array_in<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint), intent(in ) :: varID<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !--------------------------------------------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! local variables !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !--------------------------------------------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> real(real4), dimension(nx,ny,nz) :: array_masked<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! dimensions & bounds control<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(MPI_OFFSET_KIND) :: dimlenx,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">dimleny, dimlenz, dimlent<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint), dimension(NF_max_var_dims) :: dimIDs<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! dimensions & bounds control<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (myrank == 0) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (bounds_control) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, ''<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, 'atham var in xyz ',shape(array_in)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, 'atham var reshaped to xyzt <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">',shape(reshape(array_in(2:nx-1,y_st:y_sp,1:nz),shape=(/nx-2,y_cl,nz,1/)))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_inq_vardimid(NCID, u_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">dimIDs)) ! taken unew as ref<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_inq_dimlen(NCID, dimIDs(1), dimlenx))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_inq_dimlen(NCID, dimIDs(2), dimleny))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_inq_dimlen(NCID, dimIDs(3), dimlenz))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_inq_dimlen(NCID, dimIDs(4), dimlent))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, 'netCDF var dimensions in xyzt<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">',dimlenx,dimleny,dimlenz,dimlent<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! mask topography<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> where (iflgs == 1)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> array_masked = array_in<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> elsewhere<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> array_masked = undef<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> endwhere<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! mask control<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !print *, ''<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !print *, 'topography mask'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !print *, iflgs(1:5,3,3)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !print *, iflgs(1:5,3,2)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !print *, iflgs(1:5,3,1)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !print *, ''<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !print *, 'masked variable array'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !print *, array_masked(:,3,3)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !print *, array_masked(:,3,2)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !print *, array_masked(:,3,1)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !print *, ''<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_begin_indep_data(NCID))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_vara_real(NCID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">varID,(/istart,jstart,1_MPI_OFFSET_KIND,tcounter/), &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> (/nx_mpi,y_cl_mpi,nz_mpi,1_MPI_OFFSET_KIND/),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">reshape(array_masked(2:nx-1,y_st:y_sp,1:nz),shape=(/nx-2,y_cl,nz,1/))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_end_indep_data(NCID))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end subroutine write_data<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! ----------------------------------------------------------------<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end subroutine netcdf_data<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !=====================================================================<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> subroutine netcdf_define(outfile,out_type,timetot,ncid_def)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! IF: outfile = picture_file or movie_file (path/filename for<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">output created in atham_module)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! out_type = 1 (picture_file) or 2 (movie_file)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! timetot = simulation time since simulation start (from<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">atham/atham_out)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! ncid_def = netCDF ID assigned to file during creation<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : var_tgas_picture,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">var_tgas_movie, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> des_tgas_picture,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">des_tgas_movie, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> var_trac_picture,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">var_trac_movie, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> des_trac_picture,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">des_trac_movie, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> var_tpas_picture,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">var_tpas_movie, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> des_tpas_picture, des_tpas_movie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : iindex, spinup, nrep, periodt<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : volcano_setup,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">coignimbrite_setup, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> nuclear_setup, convection_setup,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">procsconfig_setup<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : x, y, z, xg, yg<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : grid2geo, sim_d_YYYY, sim_d_MM,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">sim_d_DD, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> sim_t_hh, sim_t_mm, sim_t_ss<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : my_cart, myrank<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(*), intent(in ) :: outfile<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint), intent(in ) :: out_type<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> real(kreal), intent(in ) :: timetot<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint), intent( out) :: ncid_def<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !------------------------------------------------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! local variables !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !------------------------------------------------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(MPI_OFFSET_KIND) :: ntx_mpi,nty_mpi,nz_mpi<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=50) :: OP ! debugging variable<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">corresponding to the called netCDF OPeration<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint) :: NCID<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint) :: i<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=50) :: var, des<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> real(kreal) :: toffset<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> real(real4) :: coord_scale,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">coord_x_offset, coord_y_offset, coord_t_offset<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> logical :: DynMovie_flag<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=3) :: coord_x_name,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">coord_y_name, coord_z_name<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=4) :: coord_t_name<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=9) :: coord_x_lname, coord_y_lname<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=13) :: coord_x_units, coord_y_units<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=33) :: coord_t_units<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=8) :: date<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=10) :: time<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=19) :: simdatetime<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=10) :: simdate<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=20) :: login<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=63) :: hist_string<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer(kint) :: isetup<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=12) :: model_setup(6)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> data model_setup /'volcano ', 'coignimbrite', 'nuclear ',<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'convection ', 'procsconfig ','unknown '/<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! replace DynMovie precompiler flag by program flag for more<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">convenient code structure<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> DynMovie_flag = .false.<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">#ifdef DynMovie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> DynMovie_flag = .true.<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">#endif<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! re-assign dimension lengths as an MPI_Offset type (necessary for<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">the PnetCDF interface)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! cut-off domain borders<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ntx_mpi = ntx-2<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> nty_mpi = nty-2<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> nz_mpi = nz<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! convert date and time integers into string 'YYYYMMDD hh:mm:ss'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> write (simdatetime,10)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">sim_d_YYYY,sim_d_MM,sim_d_DD,sim_t_hh,sim_t_mm,sim_t_ss<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">10 format (I4,'-',I2,'-',I2,1X,I2,':',I2,':',I2)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> simdate = simdatetime(1:10)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! switch between cartesian axes/time (default) and geographic<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">axes/date (linear approx)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_scale = 1._real4<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_x_offset = 0._real4<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_x_name = 'x '<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_x_lname = 'x_coor '<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_x_units = 'm '<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_y_offset = 0._real4<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_y_name = 'y '<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_y_lname = 'y_coor '<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_y_units = 'm '<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_z_name = 'z '<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_t_offset = 0._real4<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_t_name = 'time'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_t_units = 'sec '<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (grid2geo) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">gridconvert(coord_scale,coord_x_offset,coord_x_name,coord_x_lname,coord_x_units,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">&<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">coord_y_offset,coord_y_name,coord_y_lname,coord_y_units, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">coord_z_name,coord_t_offset,coord_t_name,coord_t_units)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! === create netCDF dataset: enter define mode --------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'enter define mode'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_create(my_cart, trim(outfile), 0,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">MPI_INFO_NULL,NCID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ncid_def = NCID<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! === create netCDF dataset: assign metadata ----------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! --- set global attributes ----------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'set global attributes'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (out_type == 1) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> toffset = timetot - spinup<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, NF_GLOBAL, 'title',<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">13_MPI_OFFSET_KIND, 'atham_picture'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> else<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> toffset = timetot - spinup - nrep*periodt<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, NF_GLOBAL, 'title',<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">11_MPI_OFFSET_KIND, 'atham_movie'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, NF_GLOBAL, 'content',<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">223_MPI_OFFSET_KIND, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> 'This data corresponds to a simulation run of the<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">mesoscale-beta/gamma type non-hydrostatic Active Tracer<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">High-resolution Atmospheric Model ATHAM ' &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> // '(Oberhuber et al., 1998, Herzog, 1998), for a setup as<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">specified under history'),OP) ! ######### add further description as<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">necessary<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, NF_GLOBAL, 'version',<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">21_MPI_OFFSET_KIND, 'no current versioning'),OP) ! ######### change<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">once available<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call date_and_time(date, time)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call getlog(login)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (volcano_setup) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> isetup=1<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> else if (coignimbrite_setup) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> isetup=2<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> else if (nuclear_setup) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> isetup=3<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> else if (convection_setup) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> isetup=4<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> else if (procsconfig_setup) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> isetup=5<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> else<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> isetup=6<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> hist_string = trim(date//' '//time//' '//trim(login)//' atham <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'//model_setup(isetup))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, NF_GLOBAL, 'history',<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">63_MPI_OFFSET_KIND, hist_string),OP) ! 1 line/modification: - cmd arg<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, NF_GLOBAL,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'Conventions', 28_MPI_OFFSET_KIND, 'COARDS, //cf-pcmdi.llnl.gov/'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, NF_GLOBAL,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'sim_onset_date_time', 19_MPI_OFFSET_KIND, simdatetime),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, NF_GLOBAL,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'sim_time_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, real(toffset,real4)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, NF_GLOBAL,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'x_zoom_location', NF_FLOAT, 1_MPI_OFFSET_KIND,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">real(x(max(1,iindex)),real4)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! --- define dimensions --------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'define dimensions'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_dim(NCID, trim(coord_x_name), <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">ntx_mpi, x_dimID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (nty>4) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_dim(NCID, trim(coord_y_name), <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">nty_mpi, y_dimID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> else<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_dim(NCID, trim(coord_y_name), <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">1_MPI_OFFSET_KIND, y_dimID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_dim(NCID, trim(coord_z_name), <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">nz_mpi, z_dimID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_dim(NCID, coord_t_name, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">nfmpi_unlimited, t_dimID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! --- define variables ---------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! dimensions<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'define variables - dimensions'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, trim(coord_x_name), <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NF_FLOAT, 1, x_dimID, x_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, trim(coord_y_name), <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NF_FLOAT, 1, y_dimID, y_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, trim(coord_z_name), <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NF_FLOAT, 1, z_dimID, z_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, coord_t_name, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NF_FLOAT, 1, t_dimID, t_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! dynamics data<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'define variables - data'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (out_type == 1 .OR. DynMovie_flag == .true.) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, 'u', NF_FLOAT, 4,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/x_dimID,y_dimID,z_dimID,t_dimID/), u_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, 'v', NF_FLOAT, 4,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/x_dimID,y_dimID,z_dimID,t_dimID/), v_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, 'w', NF_FLOAT, 4,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/x_dimID,y_dimID,z_dimID,t_dimID/), w_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, 'pnew', NF_FLOAT, 4,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/x_dimID,y_dimID,z_dimID,t_dimID/), pnew_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, 'tetnew', NF_FLOAT, 4,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/x_dimID,y_dimID,z_dimID,t_dimID/), tetnew_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, 'tempnew', NF_FLOAT, 4,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/x_dimID,y_dimID,z_dimID,t_dimID/), tempnew_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, 'density', NF_FLOAT, 4,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/x_dimID,y_dimID,z_dimID,t_dimID/), density_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, 'turbhor', NF_FLOAT, 4,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/x_dimID,y_dimID,z_dimID,t_dimID/), turbhor_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, 'turbver', NF_FLOAT, 4,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/x_dimID,y_dimID,z_dimID,t_dimID/), turbver_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, 'turblen', NF_FLOAT, 4,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/x_dimID,y_dimID,z_dimID,t_dimID/), turblen_varID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! tracer data<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (out_type == 1) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntgas_picture<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, var_tgas_picture(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NF_FLOAT, 4, (/x_dimID,y_dimID,z_dimID,t_dimID/), tgas_varID(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntrac_picture<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, var_trac_picture(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NF_FLOAT, 4, (/x_dimID,y_dimID,z_dimID,t_dimID/), trac_varID(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntpas_picture<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, var_tpas_picture(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NF_FLOAT, 4, (/x_dimID,y_dimID,z_dimID,t_dimID/), tpas_varID(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntrac_picture<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> var='d_'//trim(var_trac_picture(i))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, var, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NF_FLOAT, 3, (/x_dimID,y_dimID,t_dimID/), d_trac_varID(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> else if (out_type == 2) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntgas_movie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, var_tgas_movie(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NF_FLOAT, 4, (/x_dimID,y_dimID,z_dimID,t_dimID/), tgas_varID(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntrac_movie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, var_trac_movie(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NF_FLOAT, 4, (/x_dimID,y_dimID,z_dimID,t_dimID/), trac_varID(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntpas_movie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_def_var(NCID, var_tpas_movie(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">NF_FLOAT, 4, (/x_dimID,y_dimID,z_dimID,t_dimID/), tpas_varID(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> endif<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! --- assign attributes --------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! common attributes: long_name, units, valid_range, scale_factor,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">add_offset, _FillValue, history, conventions<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! dimensions<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'assign attributes - dimensions'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, x_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 9_MPI_OFFSET_KIND, trim(coord_x_lname)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, x_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 13_MPI_OFFSET_KIND, trim(coord_x_units)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, x_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor', NF_FLOAT, 1_MPI_OFFSET_KIND, coord_scale),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, x_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, coord_x_offset),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, y_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 9_MPI_OFFSET_KIND, trim(coord_y_lname)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, y_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 13_MPI_OFFSET_KIND, trim(coord_y_units)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, y_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor', NF_FLOAT, 1_MPI_OFFSET_KIND, coord_scale),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, y_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, coord_y_offset),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, z_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 6_MPI_OFFSET_KIND, 'height'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, z_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 1_MPI_OFFSET_KIND, 'm'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, z_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'positive', 2_MPI_OFFSET_KIND, 'up'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, t_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 4_MPI_OFFSET_KIND, coord_t_name),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, t_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 33_MPI_OFFSET_KIND, trim(coord_t_units)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, t_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, coord_t_offset),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! OP = 'exit define mode NOW for testing<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">****************************************************' ! ah_testing<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">********************************<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">handle_err(nfmpi_enddef(NCID),OP) <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! ah_testing ********************************<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! dynamics data<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'assign attributes - data'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (out_type == 1 .OR. DynMovie_flag == .true.) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, u_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 6_MPI_OFFSET_KIND, 'x_wind'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, u_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 7_MPI_OFFSET_KIND, 'm sec-1'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, u_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, u_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, u_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, v_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 6_MPI_OFFSET_KIND, 'y_wind'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, v_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 7_MPI_OFFSET_KIND, 'm sec-1'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, v_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, v_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, v_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, w_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 19_MPI_OFFSET_KIND, 'upward_air_velocity'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, w_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 7_MPI_OFFSET_KIND, 'm sec-1'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, w_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, w_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, w_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, pnew_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 20_MPI_OFFSET_KIND, 'air_pressure_anomaly'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, pnew_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 2_MPI_OFFSET_KIND, 'Pa'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, pnew_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, pnew_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, pnew_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, tetnew_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 25_MPI_OFFSET_KIND,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'air_potential_temperature'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, tetnew_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 1_MPI_OFFSET_KIND, 'K'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, tetnew_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, tetnew_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, tetnew_varID, <br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, tempnew_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 15_MPI_OFFSET_KIND, 'air_temperature'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, tempnew_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 7_MPI_OFFSET_KIND, 'Celsius'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, tempnew_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, tempnew_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, -273.15),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, tempnew_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, density_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 11_MPI_OFFSET_KIND, 'air_density'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, density_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 6_MPI_OFFSET_KIND, 'kg m-3'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, density_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, density_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, density_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, turbhor_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 15_MPI_OFFSET_KIND, 'hor_turb_energy'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, turbhor_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 8_MPI_OFFSET_KIND, 'm2 sec-2'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, turbhor_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, turbhor_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, turbhor_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, turbver_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 15_MPI_OFFSET_KIND, 'ver_turb_energy'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, turbver_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 8_MPI_OFFSET_KIND, 'm2 sec-2'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, turbver_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, turbver_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, turbver_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, turblen_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 17_MPI_OFFSET_KIND, 'turb_length_scale'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_text(NCID, turblen_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 1_MPI_OFFSET_KIND, 'm'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, turblen_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, turblen_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! call handle_err(nfmpi_put_att_real(NCID, turblen_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! tracer data<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (out_type == 1) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, 'NetCDF output type (1-picture,2-movie) ',out_type !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">##### DO NOT REMOVE!!! optimization problem, trace source<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntgas_picture<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, tgas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 25_MPI_OFFSET_KIND, des_tgas_picture(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, tgas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 9_MPI_OFFSET_KIND, 'gram kg-1'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, tgas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1000.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, tgas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, tgas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntrac_picture<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 25_MPI_OFFSET_KIND, des_trac_picture(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 9_MPI_OFFSET_KIND, 'gram kg-1'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1000.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntpas_picture<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, tpas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 25_MPI_OFFSET_KIND, des_tpas_picture(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, tpas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 1_MPI_OFFSET_KIND, '%'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, tpas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 100.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, tpas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, tpas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntrac_picture<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> des='deposited_'//trim(des_trac_picture(i))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, d_trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 35_MPI_OFFSET_KIND, des),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, d_trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 9_MPI_OFFSET_KIND, 'gram m-2'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, d_trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1000.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, d_trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, d_trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> else if (out_type == 2) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, 'NetCDF output type (1-picture,2-movie) ',out_type !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">##### DO NOT REMOVE!!! optimization problem, trace source<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntgas_movie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, tgas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 25_MPI_OFFSET_KIND, des_tgas_movie(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, tgas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 9_MPI_OFFSET_KIND, 'gram kg-1'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, tgas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1000.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, tgas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, tgas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntrac_movie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 25_MPI_OFFSET_KIND, des_trac_movie(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 9_MPI_OFFSET_KIND, 'gram kg-1'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 1000.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, trac_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> do i=1,ntpas_movie<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, tpas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'long_name', 25_MPI_OFFSET_KIND, des_tpas_movie(i)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_text(NCID, tpas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'units', 1_MPI_OFFSET_KIND, '%'),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, tpas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'scale_factor',NF_FLOAT, 1_MPI_OFFSET_KIND, 100.),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, tpas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'add_offset', NF_FLOAT, 1_MPI_OFFSET_KIND, 0.0),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_att_real(NCID, tpas_varID(i),<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">'_FillValue', NF_FLOAT, 1_MPI_OFFSET_KIND, undef),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> enddo<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! === create netCDF dataset: exit define mode, enter data mode ----!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'exit define mode'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_enddef(NCID),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! --- write data values --------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! dimensions (only one process writes the whole dimension, i.e.<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">accross all processes)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> OP = 'write data values - dimensions'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_begin_indep_data(NCID))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (myrank==0) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_vara_real(NCID, x_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/1_MPI_OFFSET_KIND/), (/ntx_mpi/),real(xg(2:ntx-1),real4)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (nty>4) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_vara_real(NCID, y_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/1_MPI_OFFSET_KIND/), (/nty_mpi/), real(yg(2:nty-1),real4)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> else<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_vara_real(NCID, y_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/1_MPI_OFFSET_KIND/), (/1_MPI_OFFSET_KIND/), real(yg(nty-1),real4)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_put_vara_real(NCID, z_varID,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(/1_MPI_OFFSET_KIND/), (/nz_mpi/), real(z,real4)),OP)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> call handle_err(nfmpi_end_indep_data(NCID))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> contains<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! ----------------------------------------------------------------<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> subroutine<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">gridconvert(cd_scale,cd_x_offset,cd_x_name,cd_x_lname,cd_x_units, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">cd_y_offset,cd_y_name,cd_y_lname,cd_y_units, &<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">cd_z_name,cd_t_offset,cd_t_name,cd_t_units)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! IF: cd_* = coordinate parameters<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !--------------------------------------------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! linear conversion from cartesian grid into lon/lat system !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! only valid as first approxiamtion over small domains !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! to be replaced once a dyn core in a lat/lon system available !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !--------------------------------------------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : deglat_start, deglon_start<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use phys_constants, only : pi<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> real(real4), intent(inout) :: cd_scale, cd_x_offset,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">cd_y_offset, cd_t_offset<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=3), intent(inout) :: cd_x_name, cd_y_name,<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">cd_z_name<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=4), intent(inout) :: cd_t_name<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=9), intent(inout) :: cd_x_lname, cd_y_lname<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=13), intent(inout) :: cd_x_units, cd_y_units<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=33), intent(inout) :: cd_t_units<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !--------------------------------------------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! local variables !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !--------------------------------------------------------------!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> real(kreal) :: r<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> real(kreal), parameter :: a = 6378137._kreal !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(WGS 84)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> real(kreal), parameter :: b = 6356752.3142_kreal !<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">(WGS 84)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! ellipsoid radius at ATHAM domain start<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> r = a*b / sqrt((b*b*(cos(deglat_start*pi/180._kreal))**2<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">)+(a*a*(sin(deglat_start*pi/180._kreal))**2 ))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> cd_scale = real((1/r) * (180._kreal/pi),real4)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> cd_x_offset = deglon_start<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> cd_x_name = 'lon'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> cd_x_lname = 'longitude'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> cd_x_units = 'degrees_east '<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> cd_y_offset = deglat_start<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> cd_y_name = 'lat'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> cd_y_lname = 'latitude '<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> cd_y_units = 'degrees_north'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> cd_z_name = 'lev'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_t_offset = real((sim_t_hh*3600 + sim_t_mm*60<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">+sim_t_ss),real4)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_t_name = 'date'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> coord_t_units = 'seconds since '//simdate//' 00:00:00 [local]'<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! COARDS conventions require time zone from UTC to be specified<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! not necessary for local area version of ATHAM<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end subroutine gridconvert<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> ! ----------------------------------------------------------------<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end subroutine netcdf_define<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> !=====================================================================<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">! ======================================================================<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">subroutine handle_err(status,op)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> use atham_module, only : myrank<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> integer, intent (in ) :: status<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> character(len=*), optional, intent (in ) :: op<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if ( status /= nf_noerr ) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> if (myrank==0) then<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, ""<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, "P-NetCDF operation: ",trim(op)<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, trim(nfmpi_strerror(status))<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, "atham_pnetcdf error: program execution stopped"<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> print *, ""<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> stop<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> end if<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"> return<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">end subroutine handle_err<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">!<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">==============================================================================<br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><font class="Apple-style-span" face="Monaco">end module atham_pnetcdf<br></font></blockquote></blockquote><blockquote type="cite"><font class="Apple-style-span" face="Monaco"><br></font></blockquote><font class="Apple-style-span" face="Monaco"><br></font></div></blockquote></div><br></div></body></html>