Programming in Fortran issues
From MohidWiki
Revision as of 17:09, 29 January 2008 by 192.168.20.177 (talk)
This section is dedicated to information about Fortran programming issues which can be useful to programmers of MOHID.
Transform a integer or real variable in a character variable
This is a FAQ, very useful for organization of information in output files. The solution is very simple: just write the integer or real variable in the character variable, as in the following sample:
! variable declaration: integer :: neof character(len=StringLength) :: EOFName ! atribute the value of neof to EOFName write(EOFName,'(i3)') neof !(i3) is the writing format of neof