-
Notifications
You must be signed in to change notification settings - Fork 216
Porting Overview
One of the first steps many users will have to address is getting CIME based models running on their local machine. This section will describe that process. It is usually very helpful to assure that you can run a basic mpi parallel program on your machine prior to attempting a CIME port. Understanding how to compile and run the program fhello_world_mpi.F90 shown here could potentially save many hours of frustration.
program fhello_world_mpi.F90
use mpi
implicit none
integer ( kind = 4 ) error
integer ( kind = 4 ) id
integer p
character(len=MPI_MAX_PROCESSOR_NAME) :: name
integer clen
integer, allocatable :: mype(:)
real ( kind = 8 ) wtime
call MPI_Init ( error )
call MPI_Comm_size ( MPI_COMM_WORLD, p, error )
call MPI_Comm_rank ( MPI_COMM_WORLD, id, error )
if ( id == 0 ) then
wtime = MPI_Wtime ( )
write ( *, '(a)' ) ' '
write ( *, '(a)' ) 'HELLO_MPI - Master process:'
write ( *, '(a)' ) ' FORTRAN90/MPI version'
write ( *, '(a)' ) ' '
write ( *, '(a)' ) ' An MPI test program.'
write ( *, '(a)' ) ' '
write ( *, '(a,i8)' ) ' The number of processes is ', p
write ( *, '(a)' ) ' '
end if
call MPI_GET_PROCESSOR_NAME(NAME, CLEN, ERROR)
write ( *, '(a)' ) ' '
write ( *, '(a,i8,a,a)' ) ' Process ', id, ' says "Hello, world!" ',name(1:clen)
call MPI_Finalize ( error )
end program
Once you are assured that you have a basic functional MPI environment you will need to provide a few prerequisite tools for building and running CIME. * A python interpreter version 2.7 or newer * Build tools gmake and cmake * A netcdf library version 4.3 or newer built with the same compiler you will use for CIME and optionally a pnetcdf library.
Begin by copying the template file in $CIME/cime_config/xml_schemas/config_machines_template.xml to your $HOME/.cime/config_machines.xml and filling in the details specific to your machine. The completed file should conform to the schema definition provided, check it using:
xmllint --noout --schema $CIME/cime_config/xml_schemas/config_machines.xsd $HOME/.cime/config_machines.xml
config_batch.xml
and config_compilers.xml
may also need specific adjustments for your batch system and compiler. You can edit these files in place to add your machine configuration or you can place your custom configuration files in the directory $HOME/.cime/ Files in this directory are appended to the xml objects read into memory.
Once you have a basic configuration for your machine defined in XML you should try the scripts_regression_test
in directory cime/utils/python/tests. This script will run a number of basic unit tests starting from the simplest issues
and working toward more complicated ones.
Finally when all the previous steps have run correctly, you are ready to try a case at your target compset and resolution.