create_cf Function

public function create_cf(grid_name, im_world, jm_world, nx, ny, lm, cs_stretch_param, rc) result(cf)

Uses

  • proc~~create_cf~2~~UsesGraph proc~create_cf~2 create_cf module~mapl_configmod MAPL_ConfigMod proc~create_cf~2->module~mapl_configmod ESMF ESMF module~mapl_configmod->ESMF module~mapl_exceptionhandling MAPL_ExceptionHandling module~mapl_configmod->module~mapl_exceptionhandling module~mapl_errorhandlingmod MAPL_ErrorHandlingMod module~mapl_exceptionhandling->module~mapl_errorhandlingmod module~mapl_throwmod MAPL_ThrowMod module~mapl_exceptionhandling->module~mapl_throwmod module~mapl_errorhandlingmod->module~mapl_throwmod mpi mpi module~mapl_errorhandlingmod->mpi

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: grid_name
integer, intent(in) :: im_world
integer, intent(in) :: jm_world
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: lm
real, intent(in) :: cs_stretch_param(3)
integer, intent(out), optional :: rc

Return Value type(ESMF_Config)


Calls

proc~~create_cf~2~~CallsGraph proc~create_cf~2 create_cf interface~mapl_configsetattribute MAPL_ConfigSetAttribute proc~create_cf~2->interface~mapl_configsetattribute proc~mapl_configcreate MAPL_ConfigCreate proc~create_cf~2->proc~mapl_configcreate proc~mapl_return MAPL_Return proc~create_cf~2->proc~mapl_return proc~mapl_verify MAPL_Verify proc~create_cf~2->proc~mapl_verify proc~mapl_configcreate->proc~mapl_return ESMF_ConfigCreate ESMF_ConfigCreate proc~mapl_configcreate->ESMF_ConfigCreate buffer buffer proc~mapl_configcreate->buffer at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Called by

proc~~create_cf~2~~CalledByGraph proc~create_cf~2 create_cf program~ut_regridding ut_ReGridding program~ut_regridding->proc~create_cf~2

Source Code

    function create_cf(grid_name,im_world,jm_world,nx,ny,lm,cs_stretch_param,rc) result(cf)
       use MAPL_ConfigMod
       type(ESMF_Config)              :: cf
       character(len=*), intent(in) :: grid_name
       integer, intent(in)          :: im_world,jm_world
       integer, intent(in)          :: nx,ny
       integer, intent(in)          :: lm
       real, intent(in)             :: cs_stretch_param(3)
       integer, optional, intent(out) :: rc

       integer :: status
       character(len=2) :: pole,dateline
       integer :: nn

       nn = len_trim(grid_name)
       dateline=grid_name(nn-1:nn)
       pole=grid_name(1:2)

       cf = MAPL_ConfigCreate(_RC)
       call MAPL_ConfigSetAttribute(cf,value=NX, label=trim(grid_name)//".other:",_RC)
       call MAPL_ConfigSetAttribute(cf,value=NX, label=trim(grid_name)//".NX:",_RC)
       call MAPL_ConfigSetAttribute(cf,value=lm, label=trim(grid_name)//".LM:",_RC)
       if (jm_world==6*im_world) then
          call MAPL_ConfigSetAttribute(cf,value="Cubed-Sphere", label=trim(grid_name)//".GRID_TYPE:",_RC)
          call MAPL_ConfigSetAttribute(cf,value=6, label=trim(grid_name)//".NF:",_RC)
          call MAPL_ConfigSetAttribute(cf,value=im_world,label=trim(grid_name)//".IM_WORLD:",_RC)
          call MAPL_ConfigSetAttribute(cf,value=ny/6, label=trim(grid_name)//".NY:",_RC)
          if (any(cs_stretch_param/=cs_stretch_uninit)) then
             call MAPL_ConfigSetAttribute(cf,value=cs_stretch_param(1),label=trim(grid_name)//".STRETCH_FACTOR:",_RC)
             call MAPL_ConfigSetAttribute(cf,value=cs_stretch_param(2),label=trim(grid_name)//".TARGET_LON:",_RC)
             call MAPL_ConfigSetAttribute(cf,value=cs_stretch_param(3),label=trim(grid_name)//".TARGET_LAT:",_RC)
          end if

       else
          call MAPL_ConfigSetAttribute(cf,value="LatLon", label=trim(grid_name)//".GRID_TYPE:",_RC)
          call MAPL_ConfigSetAttribute(cf,value=im_world,label=trim(grid_name)//".IM_WORLD:",_RC)
          call MAPL_ConfigSetAttribute(cf,value=jm_world,label=trim(grid_name)//".JM_WORLD:",_RC)
          call MAPL_ConfigSetAttribute(cf,value=ny, label=trim(grid_name)//".NY:",_RC)
          call MAPL_ConfigSetAttribute(cf,value=pole, label=trim(grid_name)//".POLE:",_RC)
          call MAPL_ConfigSetAttribute(cf,value=dateline, label=trim(grid_name)//".DATELINE:",_RC)
       end if

       _RETURN(_SUCCESS)
     end function create_cf