strTemplate_
- expanding a format template to a string
! uc_class=uppercase(tmpl_class)
Type | Intent | Optional | 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 |
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_