strTemplate_ Subroutine

public subroutine strTemplate_(str, tmpl, class, xid, nymd, nhms, stat)

strTemplate_ - expanding a format template to a string

History

  • 03Jun99 - Jing Guo guo@dao.gsfc.nasa.gov - initial prototype/prolog/code
  • 08Jan01 - da Silva: moved uppercase() to outside select() to avoid coredump on Linux/PGI.

! uc_class=uppercase(tmpl_class)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(out) :: str
character(len=*), intent(in) :: tmpl
character(len=*), intent(in), optional :: class
character(len=*), intent(in), optional :: xid
integer, intent(in), optional :: nymd
integer, intent(in), optional :: nhms
integer, intent(out), optional :: stat

Calls

proc~~strtemplate_~~CallsGraph proc~strtemplate_ strTemplate_ proc~gx_ GX_ proc~strtemplate_->proc~gx_

Called by

proc~~strtemplate_~~CalledByGraph proc~strtemplate_ strTemplate_ interface~esmf_cfiostrtemplate ESMF_CFIOstrTemplate interface~esmf_cfiostrtemplate->proc~strtemplate_ proc~esmf_cfiosdffilecreate ESMF_CFIOSdfFileCreate proc~esmf_cfiosdffilecreate->proc~strtemplate_ proc~esmf_cfiosdffileopen ESMF_CFIOSdfFileOpen proc~esmf_cfiosdffileopen->proc~strtemplate_ proc~esmf_cfiofilecreate ESMF_CFIOFileCreate proc~esmf_cfiofilecreate->proc~esmf_cfiosdffilecreate proc~esmf_cfiofileopen ESMF_CFIOFileOpen proc~esmf_cfiofileopen->proc~esmf_cfiosdffileopen none~find~33 CFIOCollection%find none~find~33->proc~esmf_cfiofileopen proc~mapl_cfiocreatewrite MAPL_CFIOCreatewrite proc~mapl_cfiocreatewrite->proc~esmf_cfiofilecreate proc~mapl_cfioopenwrite MAPL_CFIOOpenWrite proc~mapl_cfioopenwrite->proc~esmf_cfiofileopen program~test test program~test->proc~esmf_cfiofileopen program~test~10 test program~test~10->proc~esmf_cfiofileopen program~test~11 test program~test~11->proc~esmf_cfiofilecreate program~test~12 test program~test~12->proc~esmf_cfiofilecreate program~test~14 test program~test~14->proc~esmf_cfiofilecreate program~test~2 test program~test~2->proc~esmf_cfiofilecreate program~test~2->proc~esmf_cfiofileopen program~test~3 test program~test~3->proc~esmf_cfiofilecreate program~test~4 test program~test~4->proc~esmf_cfiofileopen program~test~5 test program~test~5->proc~esmf_cfiofilecreate program~test~6 test program~test~6->proc~esmf_cfiofilecreate program~test~7 test program~test~7->proc~esmf_cfiofilecreate program~test~8 test program~test~8->proc~esmf_cfiofilecreate program~test~9 test program~test~9->proc~esmf_cfiofilecreate proc~mapl_cfiocreatefromfile MAPL_CFIOCreateFromFile proc~mapl_cfiocreatefromfile->none~find~33 proc~mapl_cfioreadbundleread MAPL_CFIOReadBundleRead proc~mapl_cfioreadbundleread->none~find~33

Source Code

    subroutine strTemplate_(str,tmpl,class,xid,nymd,nhms,stat)
      implicit none

      character(len=*),intent(out) :: str ! the output

      character(len=*),intent(in ) :: tmpl ! a "format"

      character(len=*),intent(in ),optional :: class
      ! choose a UNIX or a GrADS(defulat) type format

      character(len=*),intent(in ),optional :: xid
      ! a string substituting a "%s".  Trailing
      ! spaces will be ignored

      integer,intent(in ),optional :: nymd
      ! yyyymmdd, substituting "%y4", "%y2", "%m1",
      ! "%m2", "%mc", "%Mc', and "%MC"

      integer,intent(in ),optional :: nhms
      ! hhmmss, substituting "%h1", "%h2", "%h3",
      ! and "%n2"

      integer,intent(out),optional :: stat
      ! error code

  character(len=*),parameter :: myname_=myname//'::strTemplate_'
  character(len=16) :: tmpl_class,uc_class

  tmpl_class="GX"
  if(present(class)) tmpl_class=class
!!!  uc_class=uppercase(tmpl_class)
  uc_class=trim(tmpl_class) ! removed this dependency on mpeu

  select case(uc_class)

  case("GX","GRADS")
    call GX_(str,tmpl,xid,nymd,nhms,stat)

  !case("UX","UNIX") ! yet to be implemented
  !  call UX_(str,tmpl,xid,nymd,nhms,stat)

  case default
    write(stderr,'(4a)') myname_,': unknown class, "',trim(tmpl_class),'"'
    if(.not.present(stat)) call die(myname_)
    stat=-1
    return

  end select

end subroutine strTemplate_